- This topic has 2 replies, 2 voices, and was last updated 1 month ago by .
- You must be logged in to reply to this topic.
#include "esp_sleep.h"
void setup() {
//Set GPIO 0 for wakeup HIGH (1)
esp_sleep_enable_ext0_wakeup(GPIO_NUM_0, 1);
// Go to sleep
esp_deep_sleep_start();
}
void loop() {
// Code here no
}
ESP32-C3-Zero – an error appears and the program cannot be compiled.
E:\ESP32_pgm\wakeUp_ESP32-C3-Zero\wakeUp_ESP32-C3-Zero.ino: In function 'void setup()':
E:\ESP32_pgm\wakeUp_ESP32-C3-Zero\wakeUp_ESP32-C3-Zero.ino:5:3: error: 'esp_sleep_enable_ext0_wakeup' was not declared in this scope; did you mean 'esp_sleep_enable_bt_wakeup'?
5 | void setup() {
| ^~~~~~~~~~~~
| esp_sleep_enable_bt_wakeup
exit status 1
Compilation error: 'esp_sleep_enable_ext0_wakeup' was not declared in this scope; did you mean 'esp_sleep_enable_bt_wakeup'?
When I change the board to “ESP32-WROOM-DA Module”, the compilation goes without error.
Where can the error be?
Hi Elkez,
you must import esp_sleep.h
lib.
#include <esp_sleep.h>
Bye Renzo
That didn’t help, Zero doesn’t support this command.
It is necessary to use the command:
esp_deep_sleep_enable_gpio_wakeup(1 << INTERRUPT_PIN, ESP_GPIO_WAKEUP_GPIO_HIGH);
More
3D Printer 3D printer upgrade ABB Arduino Arduino IDE Arduino SAMD boards Aurora AWS CNC Cyclone PCB Factory Cyclone PCB Factory how to build It Display E32 E70 EByte esp01 esp32 esp8266 File System Firmware i2c Library LoRa MicroPython Milling PCB My PCB Networking PCB pinout Power saving Programming board Raspberry Pi REST API RF rp2040 SD Card Sensors Sleep and Wake UP SPI STM32 Temperature Tutorial Web Server Wemos D1 mini WiFi