View Single Post
  #2   Spotlight this post!  
Unread 21-01-2013, 10:25
DjScribbles DjScribbles is offline
Programming Mentor
AKA: Joe S
FRC #2474 (Team Excel)
Team Role: Mentor
 
Join Date: Oct 2011
Rookie Year: 2012
Location: Niles MI
Posts: 284
DjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to behold
Re: Programming ultrasonic rangefinders

Quote:
Originally Posted by ekapalka View Post
Is there a benefit to using IterativeRobot instead of SimpleRobot? I'm just wondering. We've been writing all of our simple programs using SimpleRobot to demonstrate the various functions of the robot. Thanks for this, by the way! Our primary problem was a bad PWM cable. We'll be testing to see if we can get the new sensor working today.
IterativeRobot is beneficial because it splits up the periodic and continuous functions for you, provides an init function, and discourages putting blocking while loops in your Autonomous/Teleop handlers.

It makes it easier to add all of your code to the periodic functions, and if you need to add some time sensitive code, it can be added into continuous without restructuring your code.

By removing while loops (or hiding them in the base class), it helps prevent getting stuck in auton mode and never getting to teleop, and in general it encourages writing non-blocking code.
Reply With Quote