What do I mean by inverting an interrupt? I've got two switches and a push button attached to a 20x2.
Using: setint %00101100, %00101100
No problem with the push button but when one of the switches is flipped from High to Low I can no longer use the same mask to know when it's changed back to High.
I would need to use:
setint %00101000, %00101100
or
setint %00100100, %00101100
So is there a combination of and's or or's that can be used to make the new input pattern or do I just need to use an if/then structure to set it?
I'm sure there's a nicer way than doing this:
Using: setint %00101100, %00101100
No problem with the push button but when one of the switches is flipped from High to Low I can no longer use the same mask to know when it's changed back to High.
I would need to use:
setint %00101000, %00101100
or
setint %00100100, %00101100
So is there a combination of and's or or's that can be used to make the new input pattern or do I just need to use an if/then structure to set it?
I'm sure there's a nicer way than doing this:
Code:
Interrupt:
pause 150 ' debounce
IntFlags = PinsC & %00001100
if IntFlags = %00001100 then'0
setint %00001100,%0001100,C
else
if IntFlags = %00000100 then'4
setint %00001100,%0000100,C
else
if IntFlags = %00001000 then'8
setint %00001100,%00000100,C
else
if IntFlags = %00001100 then'12
setint %00001100,%00000000,C
endif
endif
endif
endif
return
'setint %00001100,%00001100,C
Last edited: