Skip to content

Commit 76737d4

Browse files
committed
Undoing revision 628 because it broke analogRead() on analog inputs 8 to 15 of the Arduino Mega.
1 parent 957ba91 commit 76737d4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cores/arduino/wiring_analog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ int analogRead(uint8_t pin)
4242
// set the analog reference (high two bits of ADMUX) and select the
4343
// channel (low 4 bits). this also sets ADLAR (left-adjust result)
4444
// to 0 (the default).
45-
ADMUX = (analog_reference << 6) | (pin & 0x0f);
45+
ADMUX = (analog_reference << 6) | (pin & 0x07);
4646

4747
#if defined(__AVR_ATmega1280__)
4848
// the MUX5 bit of ADCSRB selects whether we're reading from channels

0 commit comments

Comments
 (0)