Closed jpasichnyk closed 2 years ago
Ok, I figured out what the issue is. I was always getting an analogRead value of 1023 from the analog pins, regardless of using the numeric or A0-A15 pin numbers. It turns out that the proper way to read these pins on a Arduino Mega is A0-A15, however setting the analogReference(ANALOG_REFERENCE) causes all these values to be returned as 1023. Removing the call to set analogReference allows the pin values to be read successfully.
I'm trying to get some slide potentiometers which are connected to an Arduino mega via A0, A1, and A2 pins. Should I list these in the sketch as 0-2 or should they be 54-56?