-->
Page 1 of 1

Added interrupts for pin changes

PostPosted: Thu Dec 31, 2015 4:32 am
by Mmiscool
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

Re: Added interrupts for pin changes

PostPosted: Thu Dec 31, 2015 4:32 pm
by forlotto
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 !