I have a NodeMCU with an LED connected to GPIO12 (pin D6) with a 330 Ohm resistor going to GND. The LED blinks perfectly fine with the blink sketch, but once I include the ESP.deepSleep() it turns very slightly ON and draws about 1uA. My question is, why is this and how can I prevent it?
EDIT: I've also noticed the same behavior on other pins. Also, when I simply touch the positive leg of the LED with my finger when the LED is dim, it turns off completely. I also tried increasing the resistor from 330 to 1k and still the same problem.
#define LED 12
void setup() {
pinMode(LED, OUTPUT);
}
void loop() {
digitalWrite(LED, HIGH);
delay(1000);
digitalWrite(LED, LOW); // Runs great up to here, LED is completely off!
delay(1000);
ESP.deepSleep(5000000); // Once this runs, the LED turns very slightly on...
}