Need help with simple programming question
AiR_GuNNeR
Posts: 3
I want to activate one of three lights and monitor one of three switches based on a random number. The light part is easy. I have
Light1 var 0
Light2 var 1
Light3 var 2
LightThatIs on var WORD
I set LightThatIson to one of the lights, then call
HIGH LightThatIsOn
to activate thelight, and also use that variable to shut it off as well. The problem is I also need to monitor one of three switches depending on which light is on.
If i have this:
Switch1 PIN 4
Switch2 PIN 5
Switch3 PIN 6
ActiveSwitch var WORD
ActiveSwitch = Switch1
DO
LOOP WHILE ActiveSwitch = 0
ActiveSwitch isn't actually tied to Switch1, or Pin 4. Can you somehow declare a varable and set it to an input pin number programatically, or do you need to use the BUTTON statement?
Thanks in Advanced
Eric
Light1 var 0
Light2 var 1
Light3 var 2
LightThatIs on var WORD
I set LightThatIson to one of the lights, then call
HIGH LightThatIsOn
to activate thelight, and also use that variable to shut it off as well. The problem is I also need to monitor one of three switches depending on which light is on.
If i have this:
Switch1 PIN 4
Switch2 PIN 5
Switch3 PIN 6
ActiveSwitch var WORD
ActiveSwitch = Switch1
DO
LOOP WHILE ActiveSwitch = 0
ActiveSwitch isn't actually tied to Switch1, or Pin 4. Can you somehow declare a varable and set it to an input pin number programatically, or do you need to use the BUTTON statement?
Thanks in Advanced
Eric
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Think outside the BOX!
Regards,
Eric