Hey Guys!
Hippy & technical saved my butt a couple years back with an 18x project and I'm still so grateful!
Anyways- couldya help a newb with another basic programming problem?
The project requires lighting an LED for one timing cycle upon a SWITCH ON condition, and lighting the LED for a different timing cycle upon the SWITCH OFF condition. The circuit will have constant power. My problem is How do I make the SWITCH ON timing sequence run only once after the switch closes...and at the same time be watching for the switch opening to activate the 2nd timing cycle?
Here's my snippets of code so far:
MAINLOOP:
IF pin4 = 1 THEN goto SWITCH ON
IF pin4 = 0 THEN got SWITCH OFF
SWITCH ON:
high 0
for w0 = 0 to 100
pause w1
next w0
low 0
goto mainloop
SWITCH OFF:
high 0
for w0 = 0 to 50
pause w1
next w0
low 0
goto mainloop
Hippy & technical saved my butt a couple years back with an 18x project and I'm still so grateful!
Anyways- couldya help a newb with another basic programming problem?
The project requires lighting an LED for one timing cycle upon a SWITCH ON condition, and lighting the LED for a different timing cycle upon the SWITCH OFF condition. The circuit will have constant power. My problem is How do I make the SWITCH ON timing sequence run only once after the switch closes...and at the same time be watching for the switch opening to activate the 2nd timing cycle?
Here's my snippets of code so far:
MAINLOOP:
IF pin4 = 1 THEN goto SWITCH ON
IF pin4 = 0 THEN got SWITCH OFF
SWITCH ON:
high 0
for w0 = 0 to 100
pause w1
next w0
low 0
goto mainloop
SWITCH OFF:
high 0
for w0 = 0 to 50
pause w1
next w0
low 0
goto mainloop