//Run some startup stuff int startUp() { //Check screen LCD.Clear( FEHLCD::Black ); LCD.SetFontColor( FEHLCD::White ); LCD.WriteLine("Dan, up and running!"); Sleep(FULL_SECOND); wrenchServo.SetMin(WRENCH_SERVO_MIN); wrenchServo.SetMax(WRENCH_SERVO_MAX); wrenchServo.SetDegree(30); fuelServo.SetMin(FUEL_SERVO_MIN); fuelServo.SetMax(FUEL_SERVO_MAX); fuelServo.SetDegree(90); //Decide what checks to run if(ask("Should I test my motors?")) { checkMotors(); } RPS.InitializeTouchMenu(); //Decide what course Dan should run int course; if (ask("The main test?")) { course = 0; } else if (ask("Should I run PT1?")) { course = 1; } else if (ask("How about PT2?")){ course = 2; } else if (ask("PT3 then?")) { course = 3; } else if (ask("Time for PT4?")) { course = 4; } else { course = -1; } return course; }
Algorithm for startUp:
- Output that robot is running.
- Set the wrenchServo max, min, and degree.
- Set the fuelServo, min, max, and degree.
- Ask user if motors should be checked, if yes go to step 5, if no go to step 6.
- Check that motors are functioning
- Ask user what course Dan should run. If main test go to step 7, if PT1 go to step 8, if PT2 go to step 9, if PT3 go to step 10, if PT4 go to step 11, and if none of those are selected go to step 12.
- Return value for main course run, end function.
- Return value for PT1 run, end function.
- Return value for PT2 run, end function.
- Return value for PT3 run, end function.
- Return value for PT4 run, end function.
- Return a negative value, end function.