Current News

Moderator: Mmiscool

User avatar
By Mmiscool
#37535 Added a new command. (ESP Basic 1.69)

Documentation here
http://www.esp8266basic.com/timers-and-interrupts.html


INTERRUPT:
Will execute a specific branch when a pins status changes. The interrupt polling only occurs when the esp is waiting and useful for things like push buttons trigger events. The branch must end with the wait command.
interrupt {pin no} {branch label}
to disable an interrupt specify no branch label.
interrupt {pin no}


Example:
Will check if the status of pin zero has changed and light the on board led when the button is triggered.
Code: Select allinterrupt 0 [test]
wait
[test]
po d4 io(pi,0,)
print "It was triggered"
wait
User avatar
By forlotto
#37577 Ahhhh wow interrupts enabled excellent. This is awesome really I should test this sketch on my krida board for Zero Cross Detection light dimming it should blink every time there is a ZCD I would think most excellent!

Thanks Mike as always !