I have a NodeMCU 0.9 that I program using the Arduino IDE. I try to read a voltage using the ADC, but it doesn't work.
I connect a potentiometer between 3V3, GND and the A0 pin, and use this program:
ADC_MODE(ADC_VCC);
int val = 0;
void setup() {
Serial.begin(9600);
}
void loop() {
val = analogRead(A0);
Serial.println(val);
}
All I get on the console is 65536, whatever the value of the resistor. What's going wrong?
Thanks for your help.