I am looking for ideas on a timer or counter that will run while using ‘serin’.
I am running some code and hardware with a 08M2 that is working perfectly. Part of it uses a wireless link and most of the time the program sits waiting for a signal using the ‘serin’ command. When a signal is received, some code determines what action is to be taken.
Normally, there is no incoming signal but when it is generated, the signal repeats every eight seconds.
I have successfully written the code that requires two identical signals to be received before action is taken. I want to add some code that will start a timer after the first signal is detected and only take action if the second signal is detected within about twelve seconds.
I have tried three ways to do this, the first was using the ‘time’ command but ‘time’ appears to stop during ‘serin’.
The second way was to use a second ‘task’ running a simple 1-second clock but I cannot restart it after the very first cycle. I can only find ‘suspend’, ‘resume’ and ‘restart’ in manual 2.
The third way was to use the timeout on ‘serin’ but that goes to the same address whether it times out or not.
Any ideas?
I am running some code and hardware with a 08M2 that is working perfectly. Part of it uses a wireless link and most of the time the program sits waiting for a signal using the ‘serin’ command. When a signal is received, some code determines what action is to be taken.
Normally, there is no incoming signal but when it is generated, the signal repeats every eight seconds.
I have successfully written the code that requires two identical signals to be received before action is taken. I want to add some code that will start a timer after the first signal is detected and only take action if the second signal is detected within about twelve seconds.
I have tried three ways to do this, the first was using the ‘time’ command but ‘time’ appears to stop during ‘serin’.
The second way was to use a second ‘task’ running a simple 1-second clock but I cannot restart it after the very first cycle. I can only find ‘suspend’, ‘resume’ and ‘restart’ in manual 2.
The third way was to use the timeout on ‘serin’ but that goes to the same address whether it times out or not.
Any ideas?