        Serial.print(i); Serial.print(", ");
 //       Serial.print(current); Serial.print(", ");
        Serial.println(feedback);
-       delay(900);   // hold each brake position 1 second.
-     }
+       delay(900);   // hold each steer position 1 second.
+
+}
+/*---------------------------------------------------------------------------------------*/ 
+void CalibrateSteering(int SteerPosition, int delta)
+{
+  // This routine establishes the correct values for HardLeft, HardRight, Straight, etc.
+  // Verify that the values for left are those that turn the vehicle to the let.
+  // It allows us to establish the constants to map the feedback to the commanded position.
+  
+  // PWM signal is only effective from 127 to 255.
+  // Some of the extreme values produce no motion in an unattached servo.
+  // When the servo is atached to the steering link, pushing too hard can draw too much power and blow a fuse.
+  
+  // Perform this test first with an unattached servo.
+  // Repeat with an attached servo.
+  
+ // It would be a good idea to put an ammeter on the steering servo to verify that excess current is not being drawn;
+ // In case current gets too high, abort by unplugging the servo.
+  // Use the serial monitor, and save the results for analysis.
+  
+  // Mechanically position the steering link so that servo motion half-way between extremes is straight ahead.
+
+       delta = abs(delta);
+       int i;
+       Serial.println("Calibrate steering");
+       if (SteerPosition >= Straight)
+       { 
+         for (i = Straight; i <= SteerPosition; i += delta)
+             moveSteer(i);
+         for (i = SteerPosition; i >= Straight; i -= delta)
+             moveSteer(i);
+       }
+       else
+      { 
+         for (i = Straight; i >= SteerPosition; i -= delta)
+             moveSteer(i);
+         for (i = SteerPosition; i <= Straight; i += delta)
+             moveSteer(i);
+
+       }       
+      moveSteer(Straight);    
+    
 }
 int compareint (const void * a, const void * b)
 {

        Instrument[Steering].CloseEnough = 1;
        Instrument[Steering].Stuck = 3;
        Instrument[Steering].MinPosition = 85;  // anolog read range is 0 to 1023
        Instrument[Steering].MaxPosition = 800;
        
        Instrument[Brakes].EnablePin = EnableBrake;
        Instrument[Brakes].SignalPin = DiskBrake;

       delay(900);   // hold each brake position 1 second.
     }
}
void moveSteer(int i)
{
       int feedbacks[5];
       analogWrite(Steer, i);
//       int current =  analogRead(CurrentBrake);
       delay(95);  // allow tiime for steer to respond
