I have a machine that give high or low output ([switch#state]) to my esp.
when the machine turns on, a fan must blow.
when the machine turns off the fan most blow for 5 more seconds en than turn off (if the machine is still off).
In the rules I have problems with the timer in the code below it does not turn the fan off after 5 seconds.
if I place "timerSet,1,5" with "GPIO,4,1"
it turns the fan off when the machine is done.
but I need a delay, fan needs to blow 5 sec longer after the machine is done.\
what am i doing wrong
Code: Select all
on System#Boot do
//fan off
GPIO,4,1
endon
on switch#state do
if [switch#state]=1
//fan on
GPIO,4,0
else
// set timer for fan on 5 sec.
timerSet,1,5
endif
endon
On Rules#Timer=1 do
if [switch#state]=0
//fan off
GPIO,4,1
endif
endon
I am using this version of esp easy:
Build:⋄ 20104 - Mega
System Libraries:⋄ ESP82xx Core 2.6.0-dev stage, NONOS SDK 2.2.2-dev(38a443e), LWIP: 2.1.2 PUYA support
Git Build:⋄ mega-20191003