- This topic has 4 replies, 4 voices, and was last updated 11 months, 1 week 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);
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
Just like a well-organized workbench, this website uses cookies to function properly and efficiently.
🛠️ The Essentials (Necessary): Some cookies are categorized as necessary and are stored on your browser because they are critical for the basic working of the site.
📊 The Analytics (Third-party): We also use third-party cookies to help us analyze traffic and understand which projects you like the most. These are stored only if you give us the green light.
You can choose to opt-out, but keep in mind that disabling them might make the site experience a bit less "smooth".
| Cookie | Duration | Description |
|---|---|---|
| cookielawinfo-checkbox-analytics | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics". |
| cookielawinfo-checkbox-functional | 11 months | The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional". |
| cookielawinfo-checkbox-necessary | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary". |
| cookielawinfo-checkbox-others | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other. |
| cookielawinfo-checkbox-performance | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance". |
| viewed_cookie_policy | 11 months | The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data. |
