Hello everyone, basically im trying to wake up the board using gpio. Right now im using two buttons but if possible the goal is to use one to wake up and put sleep.
This is what i got so far by using the gpio example
How to use the gpio example for deep sleep
How to use the gpio example for deep sleep
- Attachments
-
- gpio_example_main.c
- (3.83 KiB) Downloaded 640 times
-
- Posts: 118
- Joined: Tue Jun 26, 2018 3:09 am
Re: How to use the gpio example for deep sleep
Hi,
The first parameter of `esp_sleep_enable_ext1_wakeup` is the rtc_gpio pin mask, not the rtc_gpio number.
```
else if(io_num == GPIO_INPUT_IO_1){
printf("Wake up\n");
gpio_set_level(GPIO_INPUT_IO_1, 0);
esp_sleep_enable_ext1_wakeup(0x1 << GPIO_INPUT_IO_1, 0);
}
````
The first parameter of `esp_sleep_enable_ext1_wakeup` is the rtc_gpio pin mask, not the rtc_gpio number.
```
else if(io_num == GPIO_INPUT_IO_1){
printf("Wake up\n");
gpio_set_level(GPIO_INPUT_IO_1, 0);
esp_sleep_enable_ext1_wakeup(0x1 << GPIO_INPUT_IO_1, 0);
}
````
wookooho
Re: How to use the gpio example for deep sleep
Thanks for your reply, i fixed it and its working fine
Who is online
Users browsing this forum: No registered users and 162 guests