- This topic has 4 replies, 4 voices, and was last updated 1 week ago by .
Viewing 4 reply threads
Viewing 4 reply threads
- 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);
Encountering compilation errors with the ESP32-C3 Zero can be challenging. Ensure your development environment is up-to-date, including the latest board definitions and libraries. If issues persist, consider exploring alternative microcontrollers like the STM32L152RBT6, an ultra-low-power ARM Cortex-M3 MCU with 128 KB Flash memory and advanced peripherals, suitable for various applications. This might better align with your project’s requirements and provide a more stable development experience.
Thank you so much for the info.
More