That seems like a pretty solid way to do things. Since I started I did some work programming LED patterns with state machines, but am still a bit confused with how to set the rate at which commands happen, and the rate at which each command needs to be executed. Is there some documentation somewhere about this? Like how often you need to query sensors or read joystick values or send motors commands? I still don't understand Periodic(). I thought you put stuff inside it like this:
Code:
UINT16 numloop_within_second = numloops % (UINT32)GetLoopsPerSec();
if (numloop_within_second == GetLoopsPerSec/2){ //do something }
Is there some other way to set timed events?