Code Listing
Click on the links below for the full code listing for each module.
Main Module: Calls initialization functions and runs robot through the game.
Startup Module: Initilizes ports and 2 minute timer. Creates a delay function for short wait periods.
MotorControl Module: Initilizes PWM and creates functions to run each motor forwards and backwards and stop each motor wheel.
IRbeacon Module: Measures duty cycle of beacons and turns the robot to the face the correct beacon.
BallDrop Module: Opens and closes the ball dispenser door.
LineFollow Module: Finds, turns on, and follows tape lines.
GoingPlaces Module: Moves robot from dispenser to goal and goal back to dispenser.
Goals Module: Moves robot to goal and drops balls into goal.