Why does it take 26ms to get updates from the master processor… This seems like an extreamly long time. Anyone know why it takes so long?
This is as fast as the master processor gets a full data packet from the radio modem. Consequently, you won’t get updates from your joysticks any faster than that, so theres little point in updating the user processor faster than that for most things. Why so long between packets from the radio? The modem runs at 19200 bps. That’s all. Not coincidentally, that update makes for about 512 bits per update. Just 64 bytes of data per packet to carry: 4 joysticks at probably 5 bytes each, plus team number and channel info, competition control data, presumably checksums and/or error correcting info, stuff I haven’t thought of, and possible room for future expansion.
So, mostly, the update is that fast because that’s as fast as it can reasonably be made and still get data everywhere it needs to go.
Using Easy/C the necessity to think about the 26 msec from the Master is removed, the compiler lets your code run in a tight loop and simply updates the Master processor at appropriate intervals. So if next year, the Master updates every 28 msec or 22 msec instead - who cares?
With the provision of the Easy/C (WPILIB)Timer() functions, it unnecessary (IMHO) for code to base any calculations on the 26 msec interval, or programmers to be concerned about same.
Kevin’s explanation of ‘why’ is clear enough, and it is clear enough that the robots work just fine at this rate.