//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:
- Output that Dan is ready to start.
- Set the start time equal to TimeNow.
- Display the light values while Dan waits for them to turn on.
- When light turns on, output GO!.
- Calibrate the the RPS for x and y as well as the heading.
- End function.