Chat freely about anything...

User avatar
By AdG
#72586 Due to deepsleep.....I don't get any sleep at all.... :D

I am busy with mqtt, no problem but I have one esp-01 on which I want to have the deepsleep running.
Back to basics, I first find out if a simple blinking led will work with deepsleep.
Wired pin 16 to RST but.....it is going to sleep but and it stays there.
Any suggestions?


const int sleepSeconds = 5;

void setup() {
Serial.begin(9600);
Serial.println("\n\nWake up");

pinMode(BUILTIN_LED, OUTPUT);

pinMode(16, WAKEUP_PULLUP);

// LED: LOW = on, HIGH = off
Serial.println("Start blinking");
for (int i = 0; i < 20; i++)
{
digitalWrite(BUILTIN_LED, LOW);
delay(100);
digitalWrite(BUILTIN_LED, HIGH);
delay(100);
}
Serial.println("Stop blinking");

Serial.printf("Sleep for %d seconds\n\n", sleepSeconds);

// convert to microseconds
ESP.deepSleep(sleepSeconds * 1000000);
}

void loop() {
}