Hi,
I’m not sure if I’m posting on the correct forum. Apologies if I’m not.
My question is regarding ESP8266 Thing deepsleep(). As you can see from the image - below - my 8266 consumes ~78 uA briefly before suddenly jumping to 540 uA. Is there any reason for this? How can I get it to only consume 78 uA when asleep?
Many thanks!
#include <Ticker.h> // Ticker can periodically call a function
Ticker blinker; // Ticker object called blinker.
int ledPin = 5; // LED is attached to ESP8266 pin 5.
uint8_t ledStatus = 0; // Flag to keep track of LED on/off status
int counter = 0; // Count how many times we've blinked
void setup()
{
pinMode(ledPin, OUTPUT); // Set LED pin (5) as an output
blinker.attach(0.25, blink); // Ticker on blink function, call every 250ms
}
void loop()
{
}
void blink()
{
if (ledStatus)
digitalWrite(ledPin, HIGH);
else
digitalWrite(ledPin, LOW);
ledStatus = (ledStatus + 1) % 2; // Flip ledStatus
if (counter++ > 20) // If we've blinked 20 times
ESP.deepSleep(60000000, WAKE_RF_DEFAULT); // Sleep for 60 seconds
delay(10);
}