 // current speed versus time. You should see a classic PID controller graph
 // with some overshoot.
 
+#include <PinChangeInt.h>
 #include <SimplePID.h>
 
 // Motor parameters. These are based on a Pololu #2285 motor with 48cpr

  analogWrite(RIGHT_SPEED, abs(rightSpeed));
}

void handleLeftTick() {
  if (digitalRead(2) == digitalRead(8)) {
    ++leftTicks;
  } else {
    --leftTicks;
  }
}

void handleRightTick() {
  if (digitalRead(3) != digitalRead(9)) {
    ++rightTicks;
  } else {
    --rightTicks;

const float GEAR_RATIO = 46.85;
const float ENCODER_CPR = 48;

// Number of encoder ticks per revolution of the wheel.
const float TICKS_PER_REV = GEAR_RATIO * ENCODER_CPR;

// Maximum desired motor speed. Pololu #2285 are rated for 130rpm, but we
// don't drive them with enough voltage to achieve that.
