Interrupt problem
Posted: Sun Jun 25, 2017 1:52 pm
I have a momentary normally open switch connected to pin 13 and ground. Pin 13 also has a 10k pull up resistor connected to pin 13 & +3.3v.
When I press the button the section it runs once and then when reset the interrupt the vars page tells me it that the interrupt is waiting for the pin to go high even though the pin is high when I reset the interrupt. I had very similar code in the 2.0 branch and it worked well for a long time but when I upgraded the firmware to the 3.0 branch I started getting this behavior.
1. If I read the pin before I reset the interrupt it reads high, like it should
2. I tried writing the pin high before setting the interrupt
3. I tried writing the pin low before setting the interrupt
Below is a condensed version of the code
When I press the button the section it runs once and then when reset the interrupt the vars page tells me it that the interrupt is waiting for the pin to go high even though the pin is high when I reset the interrupt. I had very similar code in the 2.0 branch and it worked well for a long time but when I upgraded the firmware to the 3.0 branch I started getting this behavior.
1. If I read the pin before I reset the interrupt it reads high, like it should
2. I tried writing the pin high before setting the interrupt
3. I tried writing the pin low before setting the interrupt
Below is a condensed version of the code
Code: Select all
interrupt garageSwitchPin, [garageButtonPress]
[garageButtonPress]
interrupt garageSwitchPin
print "buttonPress <br>"
gosub [garageFlipFlop]
delay 500
interrupt garageSwitchPin, [garageButtonPress]
wait
[garageFlipFlop]
if io(laststat,garageRelayPin) = 1 then
io(po,garageRelayPin,0)
io(po,garageIndicatePin,0)
else
io(po,garageRelayPin,1)
io(po,garageIndicatePin,1)
endif
return