title: Why do I get a verification error when trying to upload my code to my Arduino?
body: <p>I am building an Arduino car, which avoids obstacles and when I try to upload the code to my Arduino from the PlatformIO package of Atom I get an error message like this:</p>
  
  <p><em>avrdude:</em> <em>verifying</em> ...<br>
  <em>avrdude:</em> <em>verification</em> <em>error,</em> <em>first</em> <em>mismatch</em> <em>at</em> <em>byte</em> <em>0x0aaa</em><br>
           <em>0x68</em> <em>!= 0x60</em><br>
  <em>avrdude:</em> <em>verification</em> <em>error;</em> <em>content</em> <em>mismatch</em></p>
  
  <p><em>avrdude</em> <em>done.</em>  <em>Thank you.</em></p>
  
  <p>This started happening a few days ago for no reason. It worked perfectly and suddenly I started getting this error message.</p>
  
  <p>My code is:</p>
  
  <pre><code>#include &lt;Arduino.h&gt;
  #include &lt;Servo.h&gt;
  
  const int trigPin = 6;
  const int echoPin = 7;
  const int motorRF = 3;
  const int sleep = 4;
  const int motorRB = 9;
  const int motorLF = 10;
  const int motorLB = 11;
  
  int minDistance = 350;
  long value;
  int speed = 1000;
  int randNum;
  
  void setup() {
      pinMode(trigPin, OUTPUT);
      pinMode(echoPin, INPUT);
  
      pinMode(motorRF, OUTPUT);
      pinMode(motorRB, OUTPUT);
      pinMode(motorLF, OUTPUT);
      pinMode(motorLB, OUTPUT);
      pinMode(sleep, OUTPUT);
  
      Serial.begin(9600);
  }
  
  //Define the directions of the motors
  void forward() {
      analogWrite(motorRF, speed);
      analogWrite(motorLF, speed);
      analogWrite(motorRB, 0);
      analogWrite(motorLB, 0);
  }
  void backward() {
      analogWrite(motorRF, 0);
      analogWrite(motorLF, 0);
      analogWrite(motorRB, speed);
      analogWrite(motorLB, speed);
  }
  void right() {
      analogWrite(motorRF, 0);
      analogWrite(motorLF, speed);
      analogWrite(motorRB, speed);
      analogWrite(motorLB, 0);
  }
  void left() {
      analogWrite(motorRF, speed);
      analogWrite(motorLF, 0);
      analogWrite(motorRB, 0);
      analogWrite(motorLB, speed);
  }
  
  void loop() {
  //Ultrasonic sensor
      digitalWrite(trigPin, LOW);
      delayMicroseconds(5);
  
      digitalWrite(trigPin, HIGH);
      delayMicroseconds(10);
      digitalWrite(trigPin, LOW);
  
      value = pulseIn(echoPin, HIGH);
      Serial.println("Value = "); Serial.println(value);
  
      delay(50);
  
  //Motors
      digitalWrite(sleep, HIGH);
      if(value &gt; minDistance) {
      //Drive forward
          backward();
      }
      else {
      //Drive backward
          forward();
          delay(1000);
  
      //Pick between number 1 and 2
          randNum = random(0, 2);
          Serial.println("Random Num = "); Serial.println(randNum);
  
      //If the number is 2 then drive right
          if(randNum == 1) {
              right();
              delay(500);
          }
      //Else drive left
          else {
              left();
              delay(500);
          }
      }
  }
  </code></pre>
  
  <p>Thank you.</p>