mirror of
https://github.com/arduino/Arduino.git
synced 2025-02-06 01:08:25 +01:00
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
e88592771e
commit
051d8f2e4f
@ -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…
x
Reference in New Issue
Block a user