We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 72ec507 commit 59c5b94Copy full SHA for 59c5b94
hardware/arduino/cores/arduino/wiring_analog.c
@@ -42,6 +42,9 @@ int analogRead(uint8_t pin)
42
uint8_t low, high;
43
44
#if defined(analogPinToChannel)
45
+#if defined(__AVR_ATmega32U4__)
46
+ if (pin >= 18) pin -= 18; // allow for channel or pin numbers
47
+#endif
48
pin = analogPinToChannel(pin);
49
#elif defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
50
if (pin >= 54) pin -= 54; // allow for channel or pin numbers
0 commit comments