 
         initialize();
         
-        CalibrateBrakes(95,900);
-        
+        CalibrateBrakes(400);
+/*        
        CalibrateSteering(HardRight,3);     
        CalibrateSteering(HardLeft,3);
-       delay(10000);
+       delay(1000);
        CalibrateSteering(HardRight,1);
        CalibrateSteering(HardLeft,1);
-       delay(10000);
+       delay(1000);
        CalibrateSteering(HardRight,10);       
-       
+*/       
 }	
 
 /*---------------------------------------------------------------------------------------*/ 
-void CalibrateBrakes(int delayBig, int delaySmall)
-{
-  // This routine establishes the correct values for MinimumBrake and FullBrake.
+void BrakeOn()
+{
+     analogWrite(DiskBrake, FullBrake);
+}
+void BrakeOff()
+{
+     analogWrite(DiskBrake, NoBrake);
+}
+void CalibrateBrakes( int delaySmall)
+{
+  // This routine establishes the correct values for NoBrake and FullBrake.
   // Verify that the value for FullBrake stops the vehicle.
   // It allows us to establish the constants to map the feedback to the commanded position.
   

  static unsigned long EndTime = 0;
  static unsigned long OutsideTime;
  int center;
  
  for (int i = 900; i> 0; i-=10)
          CalibrateBrakes(i/10, i);
  
  
  return;
  

const int FullThrottle =  179;   // 3.5 V
const int MinimumThrottle = 39;  // Throttle has no effect until 0.75 V

const int FullBrake = 167;  // start with a conservative value; could go as high as 255;  
const int NoBrake = 207; // start with a conservative value; could go as low as 127;

const int HardLeft = 223; // was 159; // start with a conservative value; could go as high as 255;
const int HalfLeft = 223; // was 159;
