Fixing problem with uploading

Hello, could someone help with uploading sketch for Bluetooth RC car, i got this error and all kind of fix i tried did not work.
Thank you

Sketch uses 2072 bytes (6%) of program storage space. Maximum is 32256 bytes.
Global variables use 189 bytes (9%) of dynamic memory, leaving 1859 bytes for local variables. Maximum is 2048 bytes.
"C:\Users\parad\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude" "-CC:\Users\parad\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf" -v -V -patmega328p -carduino "-PCOM3" -b115200 -D "-Uflash:w:C:\Users\parad\AppData\Local\Temp\arduino-sketch-45128A9FED268169F1AF68E30FAF7EC0/sketch_jan6a.ino.hex:i"

avrdude: Version 6.3-20190619
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch

     System wide configuration file is "C:\Users\parad\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf"

     Using Port                    : COM3
     Using Programmer              : arduino
     Overriding Baud Rate          : 115200

avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00

avrdude done. Thank you.

Failed uploading: uploading error: exit status 1

Welcome to the forum

Which Arduino board are you using ?
Are you by any chance using pins 0 and 1 for your Bluetooth serial connection ?

Please post your full sketch

Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'

Use code tags (the </> icon above the compose window) to make it easier to read and copy for examination

1 Like
void setup() {
pinMode(13,OUTPUT);   //left motors   forward
pinMode(12,OUTPUT);   //left motors reverse
pinMode(11,OUTPUT);   //right   motors forward
pinMode(10,OUTPUT);   //right motors reverse
pinMode(9,OUTPUT);    //Led
Serial.begin(9600);
 
}
 
void loop() {
if(Serial.available()){
   t = Serial.read();
  Serial.println(t);
}
 
if(t == 'F'){            //move   forward(all motors rotate in forward direction)
  digitalWrite(13,HIGH);
   digitalWrite(11,HIGH);
}
 
else if(t == 'B'){      //move reverse (all   motors rotate in reverse direction)
  digitalWrite(12,HIGH);
  digitalWrite(10,HIGH);
}
   
else if(t == 'L'){      //turn right (left side motors rotate in forward direction,   right side motors doesn't rotate)
  digitalWrite(11,HIGH);
}
 
else   if(t == 'R'){      //turn left (right side motors rotate in forward direction, left   side motors doesn't rotate)
  digitalWrite(13,HIGH);
}

else if(t ==   'W'){    //turn led on or off)
  digitalWrite(9,HIGH);
}
else if(t == 'w'){
   digitalWrite(9,LOW);
}
 
else if(t == 'S'){      //STOP (all motors stop)
   digitalWrite(13,LOW);
  digitalWrite(12,LOW);
  digitalWrite(11,LOW);
   digitalWrite(10,LOW);
}
delay(100);
}

MOD edit - fixed code tags

Looking at your code, I guess that post #2 was right about the cause.

I'm using pins 0 and 1(RX, TX) for bluetooth, but what am i supposed to do with it , sorry for not understanding, it's like my second project with arduino.

Just disconnect the Bluetooth when uploading your code

Check if it works

didn't work

Disconnect everything from the Arduino except for the USB lead. Can you upload the Blink example ?

If so, then can you upload your sketch ?

What is connected to the Arduino to make your car work ? How is the car powered ?

Seeing a schematic of your project would be helpful

Blink works fine, car is powered by 4, 1.5 V batteries through DUAL H-BRIDGE MOTOR DRIVER L298N, but i cannot upload sketch

Did you disconnect the Bluetooth module before starting the upload? Your diagram shows that it's connected to pins 0 and 1. See post #2.

That is almost certainly because you are using the same pins (0 and 1) as the Serial interface that is used to upload code. Disconnect the Bluetooth module and try an upload

uploaded succesfully, thank you

The problem would have been identified earlier if you had answered the question about the pins being used in reply #2

Do you understand the problem ?

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