 {
   if (digitalRead(encoderRightData1) == digitalRead(encoderRightData2))
   {
-	tickDataRight++;
+  tickDataRight++;
   }
   else
   {
-	tickDataRight--;
+  tickDataRight--;
   }
 }
 

#include "PWM.h"

const int encoderRightData1 = 3;
const int encoderRightData2 = 5;
const int encoderLeftData1 = 2;

  PWM_R = min(255, max(-255, PWM_R) );

  // Deadband
  if( abs(PWM_L) < 0.15 )
  PWM_L = 0;
  if( abs(PWM_R) < 0.15 )
  PWM_R = 0;

  if(PWM_L < 0) {
  analogWrite(leftForwardSpeed, 0);
  analogWrite(leftBackwardSpeed, -PWM_L);
  } else {
  analogWrite(leftForwardSpeed, PWM_L);
  analogWrite(leftBackwardSpeed, 0);
  }

  if(PWM_R < 0) {
  analogWrite(rightForwardSpeed, 0);
  analogWrite(rightBackwardSpeed, -PWM_R);
  } else {
  analogWrite(rightForwardSpeed, PWM_R);
  analogWrite(rightBackwardSpeed, 0);
  }

  lastErrorL = ErrorL;
  lastErrorR = ErrorR;
}
