I'm really new to Arduino. Hoping that I will get some help .
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
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);
}