Hi,
So I have my esp32 setup on deep sleep with ext0 wake up condition, everything works fine and all but I was wondering is it possible to detect "the type of click" on ext0? as in if the pin which ext0 is attached to is double pressed or long pressed. So far I can't get that to work because of the esp32 wake up boot time.
Cheers,
Detecting double clicks, long clicks on ext0 wake up source
-
- Posts: 9711
- Joined: Thu Nov 26, 2015 4:08 am
Re: Detecting double clicks, long clicks on ext0 wake up source
You may be able to use an ULP program to do this.
Re: Detecting double clicks, long clicks on ext0 wake up source
Will ULP work with ext0? because according to http://esp-idf.readthedocs.io/en/latest ... sleep.html
"In revisions 0 and 1 of the ESP32, this wakeup source is incompatible with ULP and touch wakeup sources."
Is there an example on how to program the ULP that I can refer to? I'm using Mongoose OS with C if that matters.
"In revisions 0 and 1 of the ESP32, this wakeup source is incompatible with ULP and touch wakeup sources."
Is there an example on how to program the ULP that I can refer to? I'm using Mongoose OS with C if that matters.
-
- Posts: 9711
- Joined: Thu Nov 26, 2015 4:08 am
Re: Detecting double clicks, long clicks on ext0 wake up source
It will not, but if you're using the ULP to detect stuff, you may as well use it to wake the main processor.
There's a pulse counting example for the ULP in esp-idf, maybe you can modify that to do what you want?
There's a pulse counting example for the ULP in esp-idf, maybe you can modify that to do what you want?
Re: Detecting double clicks, long clicks on ext0 wake up source
I'm having another issue related to ext0 wake up but I didn't want to open another thread so here it is
I have my ext0 attached to gpio33 (which is an rtc gpio). In terms of hardware, it is simply attached to a button that will ground it as soon as the button is pressed.
I'm printing the wakeup reason as soon as the program initiates using esp_deep_sleep_get_wakeup_cause(); and I'm getting ESP_DEEP_SLEEP_WAKEUP_UNDEFINED as the wakeup cause if the button press is too short, however, if the button press is long enough then the wakeup cause is actually correct (ESP_DEEP_SLEEP_WAKEUP_EXT0).
I have enabled the internal pull-up resistor to that pin as well with gpio_pullup_en(GPIO_NUM_33)
Is there a reason why this is happening?
I have my ext0 attached to gpio33 (which is an rtc gpio). In terms of hardware, it is simply attached to a button that will ground it as soon as the button is pressed.
I'm printing the wakeup reason as soon as the program initiates using esp_deep_sleep_get_wakeup_cause(); and I'm getting ESP_DEEP_SLEEP_WAKEUP_UNDEFINED as the wakeup cause if the button press is too short, however, if the button press is long enough then the wakeup cause is actually correct (ESP_DEEP_SLEEP_WAKEUP_EXT0).
I have enabled the internal pull-up resistor to that pin as well with gpio_pullup_en(GPIO_NUM_33)
Is there a reason why this is happening?
Re: Detecting double clicks, long clicks on ext0 wake up source
Can anyone please give me any hints or insight about that ^?
Who is online
Users browsing this forum: Bing [Bot] and 70 guests