Unfortunately, there is no way you can know when the key has stopped. So, you have 2 alternatives
1 - Let each command run for a small fraction of time before going back to prog
example
2 - Put a timeout. So, if Serin does not give you a character, turn off all outputsCode:FRT: HIGH 4 HIGH 6 pause 100 LOW 4 LOW 6 GOTO PROG
SERIN PORTA.0,T9600, 1000, Timeout, RX
Timeout:
This is from the manualCode:LOW 4 LOW 5 LOW 6 LOW 7 goto PROG
An optional Timeoutand Labelmay be included to allow the program
to continue if a character is not received within acertain amount of time.
Timeoutis specified in 1 millisecond units. If the serial input pin stays in
the idle state during the Timeouttime, the program will exit the SERIN
command and jump to Label




Bookmarks