Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By bogie
#45010 I wanted to test the analog input of the nodemcu esp8266 12E, so I connected a led as a light sensor, positive leg to the ADC pin and negative leg to ground with this simple Arduino sketch:
void setup() {
pinMode(A0, INPUT);
}
void loop() {
analogRead(A0);
Serial.println(analogRead(A0));
delay(1000);
}
All I get is gibberish from the serial monitor. I have been using an Arduino UNO but this must work very differently. Any help would be appreciated.