Problems uploading the code to the board

I'm really new to Arduino. Hoping that I will get some help :slight_smile: .
So, I'm using a Arduino Uno and my os is chrome os flex. I don't have any error in my code but when I try to upload it it says:

Arduino: 1.8.19 (Linux), Board: "Arduino Uno"

Sketch uses 3162 bytes (9%) of program storage space. Maximum is 32256 bytes.
Global variables use 449 bytes (21%) of dynamic memory, leaving 1599 bytes for local variables. Maximum is 2048 bytes.
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00
Problem uploading to board. See https://support.arduino.cc/hc/en-us/sections/360003198300 for suggestions.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

So, please help :confused:

The code is:

#include<SoftwareSerial.h>

int LF = 6;
int LB = 7;
int RF = 5;
int RB = 4;
int FL = 1;
int BL = 3;
int H = 8;

void setup()
{
  Serial.begin(9600);
  Serial.println("Car is Ready");
  pinMode(LF, OUTPUT);
  pinMode(RF, OUTPUT);
  pinMode(LB, OUTPUT);
  pinMode(RB, OUTPUT);
  pinMode(FL, OUTPUT);
  pinMode(BL ,OUTPUT);
  pinMode(H, OUTPUT);
}

void loop()
{
  if (Serial.available())
  {
    char a = Serial.read();
    Serial.print("The command is ");
    Serial.println(a);
    if (a == 'F')
      Forward();
    if (a == 'B')
      Backward();
    if (a == 'R')
      Right();
    if (a == 'L')
      Left();
    if (a == 'S')
      Stop();
    if (a == 'W')
      FrontLon();
    if (a == 'w')
      FrontLoff();
    if (a == 'U')
      BackLon();
    if (a == 'u')
      BackLoff();
    if (a == 'U')
      Hon();
    if (a == 'u')
      Hoff();
      
  }
}




void Forward()
{
  Serial.println("Going forward");
  digitalWrite(LF, HIGH);
  digitalWrite(RF, HIGH);
  digitalWrite(RB, LOW);
  digitalWrite(LB, LOW);
}

void Backward()
{
  Serial.println("Going back");
  digitalWrite(LB, HIGH);
  digitalWrite(RB, HIGH);
  digitalWrite(RF, LOW);
  digitalWrite(LF, LOW);
}

void Right()
{
  Serial.println("Going right");
  digitalWrite(LF, HIGH);
  digitalWrite(RF, LOW);
  digitalWrite(RB, HIGH);
  digitalWrite(LB, LOW);
}

void Left()
{
  Serial.println("Going left");
  digitalWrite(LF, LOW);
  digitalWrite(RF, HIGH);
  digitalWrite(RB, LOW);
  digitalWrite(LB, HIGH);
}

void Stop()
{
  Serial.println("Stopping car");
  digitalWrite(LF, LOW);
  digitalWrite(RF, LOW);
  digitalWrite(RB, LOW);
  digitalWrite(LB, LOW);
}

void FrontLon()
{
  Serial.println("Turning the front lights on!");
  digitalWrite(FL, HIGH);
}

void FrontLoff()
{
  Serial.println("Turning the front lights off!");
  digitalWrite(FL, LOW);
}

void BackLon()
{
  Serial.println("Turning the back lights on!");
  digitalWrite(BL, HIGH);
}

void BackLoff()
{
  Serial.println("Turning the back lights off!");
  digitalWrite(BL, LOW);
}
void Hon()
{
  Serial.println("Turning horn on!");
  tone(H, 1200);
}

void Hoff()
{
  Serial.println("Turning horn off!");
  noTone(H);
}

Have you got the right board and serial port selected in the Tools menu?

this is not an introductory tutorial... didn't you read the stickies?

➜ moved to a better place

1 Like

On Uno, pin 1 is used by the serial communication. Disconnect what is connected and try the upload again.

1 Like

Hello @sundae1234 and welcome to the world of Arduino!

Ok, that sounded pretty good :laughing:.

On the Uno, pin 1 is the TX pin, so it will mess up the communication between the board and your pc while trying to program. That is why the error is programmer is not responding.

Take a look at the pinout of the Uno:

I changed it. But it is the same error. Any other solutions or my Arduino have some problems?

You never answered the second post.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.