Skip to content
This repository has been archived by the owner on Oct 1, 2019. It is now read-only.

Modify with 2 sensors #2

Open
helmar74 opened this issue Feb 20, 2018 · 3 comments
Open

Modify with 2 sensors #2

helmar74 opened this issue Feb 20, 2018 · 3 comments

Comments

@helmar74
Copy link

Hi
I want to modify the project to add 2 sensors (for mailbox notification).
So the ESP32 must wake up if any of the 2 reed contacts is "pushed"
I found out, that there is an function
esp_deep_sleep_enable_ext1_wakeup
( [https://esp-idf.readthedocs.io/en/v2.0/api/system/deep_sleep.html] )
But i don't get i work. How can I define that the ESP is waking up when a reed contact on GPIO 33 or 34 is pushed?

Thanks a lot!

@SoftXperience
Copy link

Pullup/down is disabled by default with ext1, so you need to enable it for all needed pins:
gpio_pulldown_en((gpio_num_t)flapPin);
Then use the ext1 method with a mask of the pins, so you need to calculate the bits:
static const uint64_t flapSel = ((uint64_t)(((uint64_t)1)<<flapPin)); esp_sleep_enable_ext1_wakeup(flapSel | doorSel, ESP_EXT1_WAKEUP_ANY_HIGH);

@der-fpg
Copy link

der-fpg commented Feb 21, 2019

moin,

...please, would someone please give me a hint, how and where I can do this for 10 sensors :-)

greetz from fpg

@AWSW-de
Copy link

AWSW-de commented May 18, 2019

Hello,
if someone managed to integrate 2 sensors, can you please give us a hint with a sample sketch?

Kind regards and thanks in advance 😊

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants