Main: // set up defaults class Wheels: // motor speeds are in %, +=forward, -=backward, -100 to 100 SetDesired(num, percent) // sets the desired motor speed GetDesired(num, percent) // gets the desired motor speed GetCurrent(num) // gets the current motor speed Update() // resolves differences between Desired and Current class Arm: UpperLimit() // the upper limit is hit LowerLimit() // the lower limit is hit Reset() // reset the limit switch checks SuctionOn() // turn suction on SuctionOff() // turn suction off class IO: byte GetParallel() // read the parallel port, callback ArmUpperLimit: Arm->UpperLimit(); // upper limit reached, turn off motors ArmLowerLimit: Arm->LowerLimit(); // lower limit reached, turn off motors NoseDetectNoToYes: Motors->SuctionOn(); // grab the ball NoseDetectYesToNo: Motors->SuctionOff(); // the ball fell, stop sucking SendSerial(val) // send a string SetMotor(number, percent) // convert percent to a number (+-127) SetParallel(); Class Vision: array image; void CaptureImage(); // capture a frame and put it into image void Halftone(int color, int fuzzy); // halftone image at color +- fuzzy Timers: Every 100ms: Call Motors->Update(); Every 500ms: Call Arm->Reset();