Quote:
Originally posted by Gui Cavalcanti
The OI passes data to the RC in a very continuous, predictable fashion: every 26 milliseconds, one data packet is sent to the robot.
|
Not entirely true....
Although the master processor gets updated data regularly, the Stamp chip only gets data, at best, every 25ms. This is not an exact value, only an approximation. This can even be longer, depending on if it misses a packet of data.
Basically, the packets are thrown at it one after another. If it's still chuggin at some code when that packet gets there, it's gone. Then it has to wait another 25ms to get a new packet of data (total of 50ms), even if the Stamp finished executing code at 26ms and is waiting at the SERIN for new data.
There is a variable in the code that will tell you how many packets have been sent. Normally, it will be 1, meaning that only 1 packet has been sent. If it is more, then it is (delta_t * 25ms).
There are commands that will pause the execution of your code. PAUSE [number_milliseconds] will halt execution of your code for that amount of time. I don't think you can pause it for more than 8 packets of data though (200ms), or the RC flakes out. I'm not sure, haven't tried it myself, just something I heard. Try it, it won't break your robot or anything.
There's a thread on this already... instead of me trying to explain it, I'll link there. I know there's another one out there besides this one. Search for it.
http://www.chiefdelphi.com/forums/sh...mp+time+deltat