Ok, yeah, I saw that. I'll download your example and let you know what I think.
Just out of curiosity, what's the application for this?
Hey, thanks! I'm pretty sure you've heard of "Knocki" if not, search for it. Its a device that lets you turn any surface into "touch surface" and lets you interact with your smart home. I have a smartthings hub in my house and i have everything automated. I use ifttt or webcore which lets me control my switches etc by using web requests.
I have an esp-8266 with a web request script that works like this:
If
GPIO 0 is HIGH
Then
Send web request (Ifttt url that turns on my lights)
If
GPIO 2 is HIGH
Then
Send web request (Ifttt url that turns off my lights)
if you'd like i can attach the ifttt script.
Bottom line, arduino has a script about knocks if the first secret knock is validated then it turns Pin 6 to HIGH which is connected to ESP'S GPIO 0.
If the SECOND secret knock is validated it turns pin 7 to HIGH which is connected to ESP'S GPIO 2.
P.S i want to create my own because kocki is still a work in progress and idk when is it gonna be available.