Tons of thanks to Electroguard.
If any doubt prevails will get back to you.
Will request the moderator to move to appropriate thread.
Explore... Chat... Share...
Moderator: Mmiscool
let ledpin = 1 ' Your chosen led (if ledpin = 1 it uses the esp's onboard blue led)
let ledstate = 1 ' Default startup condition for the led
let buttonstate = "up"
po ledpin ledstate ' Set led to startup condition (off)
let inputpin = 0 ' Using onboard GOIO00 flashing button by default, change to suit.
interrupt inputpin [pressed] ' Will require pull-up resistor to work.
[screen]
cls
button "On" [on]
button "Off" [off]
html "<BR>"
button "Toggle" [toggle] ' new toggle button added
html "<BR>"
if ledstate == 1 then button "led is OFF - Turn it ON" [on]
if ledstate == 0 then button "led is ON - Turn it OFF" [off]
html " (give time for button status to update before clicking again)"
html "<BR>"
html "interrupts = " & count
wait
[pressed]
' This is needed because pressing and releasing the button causes 2 interrupts, press and release.
if buttonstate == "up" then buttonstate = "down" else buttonstate = "up"
if buttonstate == "down" then goto [toggle] else goto [screen] 'Only toggles led when button is pressed, not released.
[toggle]
if ledstate == 0 then ledstate = 1 else ledstate = 0
po ledpin ledstate
goto [screen]
[on]
let ledstate = 0
po ledpin ledstate
goto [screen]
[off]
let ledstate = 1
po ledpin ledstate
goto [screen]
html "interrupts = " & count
It takes about 20-25 seconds for home assistant c[…]
I tried to upgrade tof my sonoff basic R2 with the[…]
a problem Perhaps you want to define "Probl[…]
Rebooting your router will not give you a faster I[…]
There are no other notifications from esptool.py i[…]
Using the Arduino IDE, you'll learn how to set up […]
In this project, you will post to Twitter using an[…]
In this project, we will build a water level contr[…]
I guess I'm late, but I had the same problem and f[…]
Last night I received my first D1 Minis for a lear[…]
Although I am aware that this is an old post, I fe[…]