>> lookup b10,(c.0, c.1...
Reading ADC - this works for ADC only because the ADC channel number constant is the same as the pin name constant on the M2 parts. But that doesn't make it right - you really should be using the ADC channel number in the lookup (lookup b10,(8, 9... ). The ADC...