Psuedocode

//Steps a-d achieve the task of hitting the necessary buttons on the control panel.

  1. Wait for light to turn on. If it does not turn on after ten seconds, just start.
  2. Move forward then turn left, move forward until CdScell is on the light, read the light.
  3. Turn right 90 degrees, then
  4. If blue, turn left 45 degrees, turn right 45 degrees, and drive forward into button.
  5. If red, call turn right 45 degrees and then turn left 45 degrees and then call forward function for 3 inches

//Steps e-g focus on moving the switch up.

  1. Move backwards away from the control panel
  2. Turn right, then move forwards towards the car jack.
  3. Move servo motor down, then turn left and move forward. Move servo up, hitting the car jack up, move backwards, and then move the servo motor up completely.

//Steps h-j focus on grabbing the wrench

  1. Turn right towards the wrench
  2. Move forwards, until hitting the wrench holder
  3. Move backwards a little bit, lower the servo arm 90 degrees; this will attach to the wrench magnetically, then move servo arm back up, taking the wrench with it.

//Steps k-n focus on disposing of the wrench.

  1. Move backwards a bit, turn 180 degrees, and move forward until bump switches hit on the front side (side with servo and wrench) hit the wall.
  2. Move backwards a bit, then turn left and drive straight up the ramp.
  3. Turn left 45 degrees, and move forwards to the garage.
  4. Lower the servo arm 90 degrees, then move backwards so the wrench catches on the lip of the garage and is hence detached from the magnetic arm.

//Steps o-p focus on turning the wheel

  1. Move backwards, then turn left towards the fuel crank.
  2. Move backwards into the fuel crank, then turn it the appropriate direction using a rotating two-pronged rod connected to a microservo

//Steps q-u focus on pressing the finish light.

  1. Move backwards after turning the fuel crank.
  2. Turn left 90 degrees.
  3. Drive forwards, then turn left into a wall, squaring up against it.
  4. Move backwards a bit, turn right, then drive down the ramp.
  5. Turn right, move forwards a bit, then turn right again and drive forward into the finishing button.

 

Leave a Reply

Your email address will not be published. Required fields are marked *