interrupt triggering twice
Posted: Tue Jan 05, 2016 6:25 am
Dear I placed LED on PORT 12 with one end connected to VCC via 470ohms and a switch one point connected to PORT 13 other to GND. Also PORT 13 pulled up to VCC via 4.7k.
With following codes when I press switch the LED on and then off after 1500ms. Also get twice "Switch" on hyper terminal with 1500ms delay. I think it is a bug!
With following codes when I press switch the LED on and then off after 1500ms. Also get twice "Switch" on hyper terminal with 1500ms delay. I think it is a bug!
Code: Select all
print "Testing Port Out and Interrupt"
print "Switch on P13 LED on P12"
interrupt 13 [T.LED]
let a = 0
po 12 0
wait
[T.LED]
print "Switch"
if a = 0 then po 12 0 else po 12 1
if a = 0 then a = 1 else a = 0
delay 1500
wait