 /*---------------------------------------------------------------------------------------*/
 
 // Time at which this loop pass should end in order to maintain a
-// loop period of LOOP_TIME_US.
-unsigned long nextTime = micros();
+// loop period of LOOP_TIME_MS.
+unsigned long nextTime = millis();
 // Time at which we reach the end of loop(), which should be before
 // nextTime if we have set the loop period long enough.
 unsigned long endTime;


long speed_errors[ERROR_HISTORY];
long old_turn_degx1000;
// @ToDo: Remove calibration and test code to its own file.
//unsigned long calibrationTime_ms;
//unsigned long stoppedTime_ms;
//unsigned long straightTime_ms;
int  throttle_control = MIN_ACC_OUT;
int  brake_control = MIN_BRAKE_OUT;
int  steer_control = STRAIGHT_TURN_OUT;

  ComputeSpeed (&history);
  //   PrintSpeed(&history);

  Odometer_m += (float)(LOOP_TIME_MS * SpeedCyclometer_mmPs) / 1000.0;
  // Since Results have not been cleared, angle information will also be sent.
  Results->speed_cmPs = SpeedCyclometer_mmPs / 10;
//  Results->write(&Serial3);  // Send speed to C6
