Processing Code when variable changes
philipad23
Posts: 44
Hi all!
I am using the BS2 to receive signals from a remote control. The data received is stored as a word variable. I want to run a subroutine to make some process to the signal, but I dont know how to run the subroutine everytime a new signal is received and is stored to the RAM.
the code it will be like:
a VAR Word
main:
IF (new value of a, different than previous value) THEN subroutine_1
GOTO main
Thanks
Post Edited By Moderator (Chris Savage (Parallax)) : 2/7/2006 4:06:12 PM GMT
I am using the BS2 to receive signals from a remote control. The data received is stored as a word variable. I want to run a subroutine to make some process to the signal, but I dont know how to run the subroutine everytime a new signal is received and is stored to the RAM.
the code it will be like:
a VAR Word
main:
IF (new value of a, different than previous value) THEN subroutine_1
GOTO main
Thanks
Post Edited By Moderator (Chris Savage (Parallax)) : 2/7/2006 4:06:12 PM GMT
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
A VAR WORD
B VAR WORD
Main:
< Read new value for B >
IF A = B THEN MAIN
' Else, A <> B, so...
A = B
' Do the stuff you want to do when the value changes...
GOTO MAIN