aboutsummaryrefslogtreecommitdiff
path: root/cores/arduino/wiring_analog.c
diff options
context:
space:
mode:
authorDavid A. Mellis <d.mellis@arduino.cc>2009-06-15 19:40:47 +0000
committerDavid A. Mellis <d.mellis@arduino.cc>2009-06-15 19:40:47 +0000
commita0ba08b4f48fb066ba8ffd0b9655bc6135063f4d (patch)
tree07ff3ea10d2999918e0a43a6aa254bb0ebfbcf09 /cores/arduino/wiring_analog.c
parentdb605dd18b11ecfb5cd9f92c721c52cb70543384 (diff)
Changing analog read channel mask from 0x07 to 0x0f to allow for reading of the temperature and other extended channels.
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 529ad52..782a0bd 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 & 0x07);
+ ADMUX = (analog_reference << 6) | (pin & 0x0f);
#if defined(__AVR_ATmega1280__)
// the MUX5 bit of ADCSRB selects whether we're reading from channels