Hello,
Trying to create a latch that works like this. Press the trigger switch and the output led should come on an stay on press the trigger again and the led should go out. But if the trigger is held down or press and not released I would like for the circuit to ignored that and only toggle when the trigger is pressed and released . Below is the start of my program but getting error with the if the statement .
symbol sw = 1 ' Trigger input switch
symbol Led= 2 ' output led for indication only
' Program sequence press the switch release the switch led should latch or stay on press the trigger again the led should go out. Once the trigger is press and if for some reason the trigger is not released the led should stay on unit the trigger is release.
' Getting error at line 8 not sure why
Top:
if sw=1 then Top:
toggle Led
pause 500
goto Top:
Trying to create a latch that works like this. Press the trigger switch and the output led should come on an stay on press the trigger again and the led should go out. But if the trigger is held down or press and not released I would like for the circuit to ignored that and only toggle when the trigger is pressed and released . Below is the start of my program but getting error with the if the statement .
symbol sw = 1 ' Trigger input switch
symbol Led= 2 ' output led for indication only
' Program sequence press the switch release the switch led should latch or stay on press the trigger again the led should go out. Once the trigger is press and if for some reason the trigger is not released the led should stay on unit the trigger is release.
' Getting error at line 8 not sure why
Top:
if sw=1 then Top:
toggle Led
pause 500
goto Top: