SERIN Command Question
Toonzaka
Posts: 10
I have been looking at a line of code using the SERIN Command and it is confussing me.
SERIN 16, 16468, Interval, SetInterval, [noparse][[/noparse]DEC NewInteral]
I really have no idea what any of that means could someone explain it to me. I looked it up in the documentation but that was not really clear either. What exactly is going on here?
SERIN 16, 16468, Interval, SetInterval, [noparse][[/noparse]DEC NewInteral]
I really have no idea what any of that means could someone explain it to me. I looked it up in the documentation but that was not really clear either. What exactly is going on here?
Comments
Dave
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Dave Andreae
Parallax Tech Support·
Dave
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Dave Andreae
Parallax Tech Support·
You may be familiar with seeing the SERIN instruction written SERIN 16, 16468,[noparse][[/noparse]DEC NewInteral] , using this format the SERIN will wait indefinately for a serial value which means that if no value comes your program has locked up, which obviously you don't normally want to happen.
SERIN has two values you can add which allow you to wait for a certain length of time and if no value comes within that time allows you to move on with your program. The two values are the Timeout which is the length of time you want to wait and the·Tlabel is·the label the program will jump to if the Timeout times out
Below is your example written slightly differently, the SERIN will wait 200 milliseconds and if it sees no input within that time will jump to the label called Timeout.
SERIN 16, 16468,200,Timeout,[noparse][[/noparse]DEC NewInteral]
Timeout:·· 'jump here if no value within 200 mSec
Jeff T.