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 957ba91 commit 76737d4Copy full SHA for 76737d4
cores/arduino/wiring_analog.c
@@ -42,7 +42,7 @@ int analogRead(uint8_t pin)
42
// set the analog reference (high two bits of ADMUX) and select the
43
// channel (low 4 bits). this also sets ADLAR (left-adjust result)
44
// to 0 (the default).
45
- ADMUX = (analog_reference << 6) | (pin & 0x0f);
+ ADMUX = (analog_reference << 6) | (pin & 0x07);
46
47
#if defined(__AVR_ATmega1280__)
48
// the MUX5 bit of ADCSRB selects whether we're reading from channels
0 commit comments