Detecting double clicks, long clicks on ext0 wake up source

mustafacc
Posts: 12
Joined: Fri Sep 01, 2017 12:39 am

Detecting double clicks, long clicks on ext0 wake up source

Postby mustafacc » Fri Sep 01, 2017 12:42 am

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,

ESP_Sprite
Posts: 9766
Joined: Thu Nov 26, 2015 4:08 am

Re: Detecting double clicks, long clicks on ext0 wake up source

Postby ESP_Sprite » Fri Sep 01, 2017 1:35 am

You may be able to use an ULP program to do this.

mustafacc
Posts: 12
Joined: Fri Sep 01, 2017 12:39 am

Re: Detecting double clicks, long clicks on ext0 wake up source

Postby mustafacc » Fri Sep 01, 2017 1:51 am

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.

ESP_Sprite
Posts: 9766
Joined: Thu Nov 26, 2015 4:08 am

Re: Detecting double clicks, long clicks on ext0 wake up source

Postby ESP_Sprite » Fri Sep 01, 2017 1:54 am

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?

mustafacc
Posts: 12
Joined: Fri Sep 01, 2017 12:39 am

Re: Detecting double clicks, long clicks on ext0 wake up source

Postby mustafacc » Mon Sep 04, 2017 10:13 pm

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?

mustafacc
Posts: 12
Joined: Fri Sep 01, 2017 12:39 am

Re: Detecting double clicks, long clicks on ext0 wake up source

Postby mustafacc » Wed Sep 06, 2017 4:46 am

Can anyone please give me any hints or insight about that ^?

Who is online

Users browsing this forum: No registered users and 106 guests