   // Set up serial communication
   Serial.begin(57600);
 
+  // Set PWM frequency
+  setPwmFrequency(pwmPin, 1);
   // Input pins
-  pinMode(sensorPosPin, INPUT); // set MR sensor pin to be an input
-  // set joystick pins as input with pullup
+  pinMode(sensorPosPin, INPUT); // set MR sensor pin to be an
+  // set joystick pins as input with pullup 
   pinMode(joyFwdPin, INPUT_PULLUP);
   pinMode(joyBackPin, INPUT_PULLUP);
   pinMode(joyLeftPin, INPUT_PULLUP);

  // Initialize position valiables
  lastLastRawPos = analogRead(sensorPosPin);
  lastRawPos = analogRead(sensorPosPin);
}

/*

char serialBuffer[BUFSIZE];

// Pin
int pwmPin = 5; // PWM output pin for motor PD5 OC0B
int dirPin = 8; // direction output pin for motor
int sensorPosPin = A2; // input pin for MR sensor
// inputs for the joystick
