Changing analog read channel mask from 0x07 to 0x0f to allow for reading of the temperature and other extended channels.
This commit is contained in:
parent
db605dd18b
commit
a0ba08b4f4
|
@ -42,7 +42,7 @@ int analogRead(uint8_t pin)
|
||||||
// set the analog reference (high two bits of ADMUX) and select the
|
// set the analog reference (high two bits of ADMUX) and select the
|
||||||
// channel (low 4 bits). this also sets ADLAR (left-adjust result)
|
// channel (low 4 bits). this also sets ADLAR (left-adjust result)
|
||||||
// to 0 (the default).
|
// to 0 (the default).
|
||||||
ADMUX = (analog_reference << 6) | (pin & 0x07);
|
ADMUX = (analog_reference << 6) | (pin & 0x0f);
|
||||||
|
|
||||||
#if defined(__AVR_ATmega1280__)
|
#if defined(__AVR_ATmega1280__)
|
||||||
// the MUX5 bit of ADCSRB selects whether we're reading from channels
|
// the MUX5 bit of ADCSRB selects whether we're reading from channels
|
||||||
|
|
Loading…
Reference in New Issue