Markbishop16
Member
Happy Christmas to you all.
Is there a smarter or easier, way to program the following:
I want to have a slow flashing LED but the input needs to provide a fast response prefferably without using interrupt.
The only way I can do this is to break the pause time into multiple smaller pauses, each with an if statement
so "Pause 500" becomes five, pause 100, with an if statement between each to exit if the input is operated.
Is there a smarter or easier, way to program the following:
I want to have a slow flashing LED but the input needs to provide a fast response prefferably without using interrupt.
The only way I can do this is to break the pause time into multiple smaller pauses, each with an if statement
so "Pause 500" becomes five, pause 100, with an if statement between each to exit if the input is operated.
Do while input_trigger = 0 ; waiting to be operated
; all these statements give fast response and a slow flash of the led
; equivelent to 500 on 500 off
high led
pause 100 ; slow flashing led
if input_trigger = 1 then goto main
pause 100
if input_trigger = 1 then goto main
pause 100 ; slow flashing led
if input_trigger = 1 then goto main
pause 100
if input_trigger = 1 then goto main
pause 100
if input_trigger = 1 then goto main
low led
pause 100 ; slow flashing led
if input_trigger = 1 then goto main
pause 100
if input_trigger = 1 then goto main
pause 100 ; slow flashing led
if input_trigger = 1 then goto main
pause 100
if input_trigger = 1 then goto main
pause 100
loop
Last edited: