Uploading Error (Proggramer is not responding)

I want to upload my code but it is showing "Sketch uses 2826 bytes (8%) of program storage space. Maximum is 32256 bytes.
Global variables use 243 bytes (11%) of dynamic memory, leaving 1805 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=0xde
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0xde
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0xde
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0xde
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0xde
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0xde
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0xde
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0xde
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0xde
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0xde
Failed uploading: uploading error: exit status 1"

The Code:

#include <LiquidCrystal.h>

 
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
 
char inbyte;    //Setting a char variable as inbyte
int LED = 13;   //LED on pin 13
 
void setup(){
    // set up the LCD's number of columns and rows:
  lcd.begin(16, 2);
  // initialize the serial communications:
  Serial.begin(9600);
  digitalWrite(LED, LOW);
  // initialize the LED pin as an output
  pinMode(LED, OUTPUT);
 
}
 
void loop()
{
  // When a character arrives on the serial port this will be true
  if (Serial.available()) {
    // wait a bit for the entire message to arrive
    delay(100);
 
    //store the first character in var inbyte
    inbyte = Serial.read();
    if( inbyte == '1' ) function1(); //if the byte is an ASCII 0 execute function 1
    if( inbyte == '2' ) function2(); //if the byte is an ASCII 9 execute function 2
 
    //if it is * then we know to expect text input from Android
    if (inbyte == '*')
    {
      //clear lcd screen
      lcd.clear();
      // read all the available characters
      while (Serial.available() > 0)
      {
        // display each character to the LCD
        lcd.write(Serial.read());
      }
    }
  }
}
 
void function1()
{
  //Enter what you want the command to initiate (e.g LED, Servo etc)
  digitalWrite(LED, HIGH);
  lcd.clear();
  lcd.write("Function 1");
}
 
void function2()
{
  //Enter what you want the command to initiate (e.g LED, Servo etc)
  digitalWrite(LED, LOW);
  lcd.clear();
  lcd.write("Function 2");
}

The first four lines you posted are compiling (successfully).
Check your IDE... TOOLS >> BOARD >> (your board) and TOOLS >> PORT >> (your port)

That means that the code is compiled properly. The stuff following that means that there is a problem with communication between the mystery Arduino and the PC. See the Arduino uploading troubleshooting for what to do.

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