Hi all,
I have a limiter switch which has to be pressed in approximately 20sec after a command is given.
Now i want to include a timer which will start when the command is given and if for some reason the limiter switch is not pressed, a buzzer will start beeping to inform the user.
Is it good to do it as below? or is there a better way to do it?
EDIT: And is there a way to calculate the timer? or maybe how much seconds each decrement takes?
Thanks
I have a limiter switch which has to be pressed in approximately 20sec after a command is given.
Now i want to include a timer which will start when the command is given and if for some reason the limiter switch is not pressed, a buzzer will start beeping to inform the user.
Is it good to do it as below? or is there a better way to do it?
EDIT: And is there a way to calculate the timer? or maybe how much seconds each decrement takes?
Thanks
Code:
CLRF REG2
CLRF REG3
CLRF REG4
LINE1
BTFSC PORTB,1
GOTO STOP
DECFSZ REG2
BRA LINE1
DECFSZ REG3
BRA LINE1
DECFSZ REG4
BLA LINE1
GOTO BUZZER_ON
Last edited: