aboutsummaryrefslogtreecommitdiff
path: root/cores/arduino/wiring_analog.c
diff options
context:
space:
mode:
authorDavid A. Mellis <d.mellis@arduino.cc>2009-08-23 20:59:47 +0000
committerDavid A. Mellis <d.mellis@arduino.cc>2009-08-23 20:59:47 +0000
commit76737d4e28aec9d9c565ee1d8f0a4363c2c1b851 (patch)
treea36d449bf8791e7da1cf0906ea9a6bc4a751a327 /cores/arduino/wiring_analog.c
parent957ba91c1aef51712fc0c4948f0400a4ecfce902 (diff)
Undoing revision 628 because it broke analogRead() on analog inputs 8 to 15 of the Arduino Mega.
Diffstat (limited to 'cores/arduino/wiring_analog.c')
-rwxr-xr-xcores/arduino/wiring_analog.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cores/arduino/wiring_analog.c b/cores/arduino/wiring_analog.c
index 782a0bd..529ad52 100755
--- a/cores/arduino/wiring_analog.c
+++ b/cores/arduino/wiring_analog.c
@@ -42,7 +42,7 @@ int analogRead(uint8_t pin)
// set the analog reference (high two bits of ADMUX) and select the
// channel (low 4 bits). this also sets ADLAR (left-adjust result)
// to 0 (the default).
- ADMUX = (analog_reference << 6) | (pin & 0x0f);
+ ADMUX = (analog_reference << 6) | (pin & 0x07);
#if defined(__AVR_ATmega1280__)
// the MUX5 bit of ADCSRB selects whether we're reading from channels