   DirectionlastR=DirectionR;
 }
 
+void drive()
+{
+  analogWrite(EA,outputL);
+  analogWrite(EB,outputR); 
+}
 void forbac()
 {
   digitalWrite(trigpin,LOW);

  digitalWrite(pinRb,HIGH);
  DirectionL=false;
  DirectionR=false;
  analogWrite(EA,outputL);
  analogWrite(EB,outputR);
}

void left()

const int trigpin=4;
const int echopin=5;

double SetpointL=20, SetpointR=20;
double Kp=0.6, Ki=5, Kd=0;
double outputL, outputR;
double inputL, inputR, speedvalueL, speedvalueR;
