Line following pid code Please verify and help

this is 3 sensor pid line follower
2 pins each for 2 motors and 1 pin each for pwm
3 sensors

// ————————————————————————— Motors
int motor_left = {8, 9 };
int motor_right = {10, 11};
int motor_right0 = 10 ;
int motor_right1 = 11 ;
int left = 12;
int center = 13;
int right = 0;
int pwml = 3;
int pwmr = 4;
int Myint;
int Mpos;
long Diff;
long Difflast;
int Rate;
int prop;
int Deriv;
int Integral ;
int Control;
int Temp1;
int Lfast = 255;
int Rfast = 255;
int Tpos = 0;
int Highlimit = 255;
int Lowlimit = -255;
int Prop;
float Kp = 1;
float Kd = 0;
float Ki = 0;
float Interval = 0.01;
// ————————————————————————— Setup
void setup() {

// Setup motors
int i;
for(i = 0; i < 2; i++)
{
pinMode(motor_left*, OUTPUT);*
pinMode(motor_right*, OUTPUT);
_
}_
pinMode(left, INPUT);
pinMode(center, INPUT);
pinMode(right, INPUT);
_
}_
void loop()
_
{_
int left1 = digitalRead (left);
int center1 = digitalRead (center);
int right1 = digitalRead (right);
if (left1 == HIGH && center1 == LOW && right1 == HIGH)
Mpos =0 ;
Integral = 0 ;
if (left1 == HIGH && center1 == LOW && right1 == LOW)
Mpos =10;
if (left1 == HIGH && center1 == HIGH && right1 == LOW)
Mpos =20;
if (left1 == LOW && center1 == LOW && right1 == HIGH)
Mpos = -10;
if (left1 == LOW && center1 == HIGH && right1 == HIGH)
Mpos = -20;
if (left1 == HIGH && center1 == HIGH && right1 == HIGH)
_
{_
_
if (Mpos < 0 )_
_
{_
_
Mpos = -30 ;_
_
}_
_
else*_
* {*
* Mpos =30 ;*
* }*
Diff = Tpos - Mpos;
Prop = Diff * Kp;
Integral = Integral + Diff;
Integral = Integral * Ki;
Integral = Integral * Interval;
if (Integral > Highlimit)
{
Integral = Highlimit;
}
if (Integral < Lowlimit)
{
* Integral = Lowlimit;*
}
Rate = Diff - Difflast;
Deriv = Rate * Kd;
Difflast = Diff;
Control = Prop + Deriv;
Control = Control + Integral;
if (Control > Highlimit)
{
Control = Highlimit;
}
if (Control < Lowlimit)
{
* Control = Lowlimit;*
}
if (Control <= 0)
* {Temp1 = Lfast + Control;*
* Myint = Temp1;*
* analogWrite (pwml,Myint);*
* digitalWrite(motor_left[0], HIGH);
digitalWrite(motor_left[1], LOW);
digitalWrite(motor_right[0], HIGH);
digitalWrite(motor_right[1], LOW);
analogWrite (pwmr,Rfast);
_
}*_

* if (Control > 0)*
* {Temp1 = Rfast - Control;*
* Myint = Temp1;*
* analogWrite (pwmr,Myint);*
* digitalWrite(motor_left[0], HIGH);
digitalWrite(motor_left[1], LOW);
digitalWrite(motor_right[0], HIGH);
digitalWrite(motor_right[1], LOW);
analogWrite (pwml , Lfast);
_
}*_

* delay (10);*
}
}
help people :smiley: :smiley: :smiley: :smiley: :smiley: :smiley:

You have been asked, politely, many times to use the # button when posting code. Go back and fix your post.

Is this in any way related to this http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1264010217/5#5 or this http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1263737373/12#12 thread?