View Single Post
  #10   Spotlight this post!  
Unread 03-02-2015, 10:14
1452-Leo 1452-Leo is offline
Registered User
FRC #1452 (Omnicats)
Team Role: Alumni
 
Join Date: Dec 2014
Rookie Year: 2014
Location: Los Angeles
Posts: 44
1452-Leo is an unknown quantity at this point
Re: [C++] Use CAN Talons in RobotDrive

Quote:
Originally Posted by virtuald View Post
Iterative waits for each driver station packet for each iteration, whereas your original code runs in a tight loop without waiting for input. If you added a 20ms sleep in your loop, it would be vaguely equivalent to the iterative version.

Either way, you should add some sleep to your loop, otherwise you'll starve the rest of the threads on your system and you'll encounter problems. I'd recommend using iterative robot instead though, then you don't have to worry about things like that.
Thanks, I didn't realize there was an actual difference in the how the program ran for iterative, so we will probably switch over to it today.