Skip to main content
Arduino

Return to Answer

Commonmark migration
Source Link

However, does not work for:

 ADMUX = 0xC0;

See the datasheet:

ADMUX

An ADMUX of 0xC0 will be using a voltage reference of "Internal 1.1V Voltage Reference with external capacitor at AREF pin". Since you are supplying 2.5V that exceeds 1.1V and thus you get a reading of 1023.


 Serial.println((int)sensorValue);

Also, don't do serial prints inside an ISR.

However, does not work for:

 ADMUX = 0xC0;

See the datasheet:

ADMUX

An ADMUX of 0xC0 will be using a voltage reference of "Internal 1.1V Voltage Reference with external capacitor at AREF pin". Since you are supplying 2.5V that exceeds 1.1V and thus you get a reading of 1023.


 Serial.println((int)sensorValue);

Also, don't do serial prints inside an ISR.

However, does not work for:

 ADMUX = 0xC0;

See the datasheet:

ADMUX

An ADMUX of 0xC0 will be using a voltage reference of "Internal 1.1V Voltage Reference with external capacitor at AREF pin". Since you are supplying 2.5V that exceeds 1.1V and thus you get a reading of 1023.


 Serial.println((int)sensorValue);

Also, don't do serial prints inside an ISR.

Source Link
Nick Gammon
  • 38.9k
  • 13
  • 69
  • 125

However, does not work for:

 ADMUX = 0xC0;

See the datasheet:

ADMUX

An ADMUX of 0xC0 will be using a voltage reference of "Internal 1.1V Voltage Reference with external capacitor at AREF pin". Since you are supplying 2.5V that exceeds 1.1V and thus you get a reading of 1023.


 Serial.println((int)sensorValue);

Also, don't do serial prints inside an ISR.

lang-cpp

AltStyle によって変換されたページ (->オリジナル) /