How to use the gpio example for deep sleep

agualuso
Posts: 3
Joined: Tue May 14, 2019 5:44 pm

How to use the gpio example for deep sleep

Postby agualuso » Wed May 15, 2019 1:45 pm

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
Attachments
gpio_example_main.c
(3.83 KiB) Downloaded 640 times

ESP_houwenxiang
Posts: 118
Joined: Tue Jun 26, 2018 3:09 am

Re: How to use the gpio example for deep sleep

Postby ESP_houwenxiang » Thu May 16, 2019 2:54 am

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);
}
````
wookooho

agualuso
Posts: 3
Joined: Tue May 14, 2019 5:44 pm

Re: How to use the gpio example for deep sleep

Postby agualuso » Mon Jun 03, 2019 3:19 pm

Thanks for your reply, i fixed it and its working fine

Who is online

Users browsing this forum: Baidu [Spider] and 159 guests