View Single Post
  #11   Spotlight this post!  
Unread 24-07-2013, 00:19
ekapalka's Avatar
ekapalka ekapalka is offline
Registered User
FRC #3216
 
Join Date: Dec 2012
Location: Bermuda
Posts: 277
ekapalka has a spectacular aura aboutekapalka has a spectacular aura about
Re: Switching to Iterative

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?
Reply With Quote