-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Closed
Description
Hey all,
I want to explore the sleep modes on ESP32 using Arduino IDE. By referring the ESP8266 guide, I am able to put the ESP32 in deepSleep
mode.
I want to use my ESP32 in either lightSleep
or modemSleep
, both of which are not defined in #include "esp_deep_sleep.h"
nor they have separate header files in espressif\esp32\tools\sdk\include\esp32
.
Is there a way to use the other sleep modes or they are yet to be explored?
I have implemented the sleep modes in the basic Blink program for which the code is attached.
Thank you!
#include "esp_deep_sleep.h"
int ledPin = 5;
// Time to sleep (in seconds):
const int sleepTimes = 15;
void setup()
{
pinMode(ledPin, OUTPUT);
Serial.begin(115200);
}
void loop()
{
Serial.println("Hello, world!");
digitalWrite(ledPin, HIGH);
delay(1500);
digitalWrite(ledPin, LOW);
delay(1000);
Serial.println("Please wait...");
Serial.println("Entering deep sleep mode...");
// deepSleep time is defined in microseconds. Multiply
ESP.deepSleep(sleepTimes * 1000000);
}
Metadata
Metadata
Assignees
Labels
No labels