readyStart

//Looks for starting light
void readyStart() {

 LCD.WriteLine("I'm in position, ready to start!");
 Sleep(FULL_SECOND);
 LCD.Clear( FEHLCD::Black );

 float timeStart = TimeNow();

 //Display light values as Dan waits for the light to turn on
 while(lightSensor.Value() > 0.9 && timeStart + 30 > TimeNow()) {
     showInfo();
     Sleep(100);
     LCD.Clear( FEHLCD::Black );
 }
 LCD.WriteLine("GO!");


 xCalibrate = START_X - RPS.X();
 yCalibrate = START_Y - RPS.Y();
 hCalibrate = START_HEADING - RPS.Heading();

 return;
}

Algorithm for readyStart:

  1. Output that Dan is ready to start.
  2. Set the start time equal to TimeNow.
  3. Display the light values while Dan waits for them to turn on.
  4. When light turns on, output GO!.
  5. Calibrate the the RPS for x and y as well as the heading.
  6. End function.