error :exit status 1 for leonardo board

hi
i am trying to upload a firmware in leonardo board but when i am comping the code its giving me en error exit status 1
can any one help me

thank you

“code”
// #include <SoftwareSerial.h>
#include <LiquidCrystal_I2C.h>
#include <Wire.h>
#include <EEPROM.h>
// SoftwareSerial BT(8, 9); // 接收腳, 傳送腳
#define PIN_BUTTON_S3 A1
#define PIN_BUTTON_S4 A5
#define LED_R 10

#define LED_Y 13
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); // 設定 LCD I2C 位址
unsigned long BTNTimeStamp;

char val; // 儲存接收資料的變數
int rxindex = 0;
char aRxBuffer[40];
char BTName[40];
char prefixData[20] = {‘B’, ‘T’};
int subfixData = 0;
char BTCommandBuffer[50];
char LcdMessage[16];
int S3Press = 0, S4Press = 0;
int updateBTStep = 0;
//EEPROM
char value = 0;
int addr = 0;
char BTnumber[5] = {‘1’, ‘2’, ‘3’};
char readBTnumber[5];
void setup() {

lcd.begin(16, 2); // 初始化 LCD,一行 16 的字元,共 2 行,預設開啟背光
lcd.backlight(); // 開啟背光
delay(250);
lcd.noBacklight(); // 關閉背光
delay(250);
lcd.backlight();
lcd.setCursor(0, 0); // 設定游標位置在第一行行首
lcd.print(“S3 to set BT”);

// for (int i = 0; i < strlen(BTnumber); i++)
// {
// EEPROM.write(i, BTnumber*);*

  • // }*
  • // EEPROM.write(0, 0);*
  • //—EEPROM clear all*
  • // for (int i = 0 ; i < EEPROM.length() ; i++) {*
  • // EEPROM.write(i, 0);*
  • // }*
  • //—*
  • for (int i = 0; i < sizeof(readBTnumber); i++)*
  • {*
  • uint8_t s;*
  • s = EEPROM.read(i);*
  • if ((s != 0xFF) && (s != 0x00))*
  • {*
    _ readBTnumber = s;_
    * }*
    * }*
    * if (!((readBTnumber[0] == 0x00) || (readBTnumber[0] == 0xFF)))*
    * {*
    * sscanf( readBTnumber, “%u”, &subfixData);*
    * // subfixData += 2;*
    * lcd.setCursor(0, 1); // 設定游標位置在第一行行首*
    * lcd.print(subfixData);*
    * Serial.println(subfixData);*
    * }*
    * else {*
    * lcd.setCursor(0, 1); // 設定游標位置在第一行行首*
    * lcd.print(“no data”);*
    * Serial.println(“no data”);*
    * }*
    * // value = EEPROM.read(0);*
    * // Serial.println(value);*
    * // lcd.setCursor(0, 1); // 設定游標位置在第一行行首*
    * // lcd.print(subfixData);*
    * // Serial.println(subfixData);*
    * pinMode(PIN_BUTTON_S3, INPUT);
    pinMode(PIN_BUTTON_S4, INPUT);
    pinMode(LED_R, OUTPUT);
    pinMode(LED_Y, OUTPUT);
    _
    BTNTimeStamp = millis();_
    _
    Serial.begin(9600); // 與電腦序列埠連線*_
    * Serial.println(“BT is ready!”);*
    * // 設定藍牙模組的連線速率*
    * // 如果是HC-05,請改成38400*
    * Serial1.begin(9600); // 與電腦序列埠連線*
    * // BT.begin(9600);*
    }
    void loop() {
    * if (S3Press == 0)*
    * {*
    * if (digitalRead(PIN_BUTTON_S3) == HIGH) {
    _
    S3Press = 1;_
    _
    BTNTimeStamp = millis();_
    digitalWrite(LED_Y, HIGH);
    _
    // sprintf(BTCommandBuffer, “AT+UART=9600,0,0\r\n”, subfixData);_
    _
    // sprintf(BTCommandBuffer, “AT\r\n”);_
    _
    // Serial1.print(BTCommandBuffer);_
    _
    sprintf(LcdMessage, “1247-%s-%d”, prefixData, subfixData);_
    _
    lcd.clear();_
    _
    lcd.setCursor(0, 0);_
    _
    lcd.print(LcdMessage);_
    _
    lcd.setCursor(0, 1);_
    _
    lcd.print(“Updating…”);_
    } else if (digitalRead(PIN_BUTTON_S4) == HIGH) {
    _
    BTNTimeStamp = millis();_
    digitalWrite(LED_R, HIGH);
    _
    S4Press = 1;_
    _
    }_
    _
    }_
    _
    if (millis() - BTNTimeStamp >= 2000)_
    _
    {_
    _
    if (S3Press == 1)_
    _
    {_
    _
    switch (updateBTStep) {_
    _
    case 0:_
    _
    lcd.clear();_
    _
    lcd.setCursor(0, 0);_
    _
    lcd.print(“set 38400”);_
    _
    //set buadrate*_
    * sprintf(BTCommandBuffer, “AT+UART=38400,0,0\r\n”);*
    * // sprintf(BTCommandBuffer, “AT\r\n”);*
    * Serial1.print(BTCommandBuffer);*
    * Serial.println(“step 0”);*
    * updateBTStep++;*
    * break;*
    * case 1:*
    * lcd.clear();*
    * lcd.setCursor(0, 0);*
    * sprintf(LcdMessage, “1247-%s-%d”, prefixData, subfixData);*
    * lcd.print(LcdMessage);*
    * //set name*
    * sprintf(BTCommandBuffer, “AT+NAME=“1247-%s-%d”\r\n”, prefixData, subfixData);*
    * subfixData++;*
    * // sprintf(BTCommandBuffer, “AT+\r\n”);*
    * Serial1.print(BTCommandBuffer);*
    * Serial.println(“step 1”);*
    * updateBTStep = 0;*
    * S3Press = 0;*
    * digitalWrite(LED_Y, LOW);
    _
    char saveBTNumber[5];_
    _
    sprintf(saveBTNumber, “%d”, subfixData);_
    _
    for (int i = 0; i < strlen(saveBTNumber); i++)_
    _
    {_
    uint8_t s;
    _ s = saveBTNumber;
    if ((s != 0xFF) || (s != 0x00))
    {
    EEPROM.write(i, saveBTNumber);
    }
    }
    Serial.println(subfixData);
    Serial.println(saveBTNumber);
    break;
    }
    BTNTimeStamp = millis();
    } else if (S4Press == 1) {
    subfixData = 0;
    lcd.clear();
    lcd.setCursor(0, 0);
    lcd.print(“set 0”);
    BTNTimeStamp = millis();_

    digitalWrite(LED_R, LOW);
    _ //—EEPROM clear all*
    * for (int i = 0 ; i < EEPROM.length() ; i++) {
    EEPROM.write(i, 0);
    }
    //—
    S4Press = 0;
    }
    }
    // if (millis() - BTNTimeStamp >= 1000)
    // {_

    // if (digitalRead(PIN_BUTTON_S3) == HIGH) {
    _ // // turn LED on:_
    // digitalWrite(LED_Y, HIGH);
    _ // //LCD Message*
    * // if (subfixData == 0)
    // {
    // subfixData = 1;
    // }
    // // sprintf(LcdMessage, “1247-%s-%d”, prefixData, subfixData);
    // sprintf(LcdMessage, “1247-%s-%d”, prefixData, subfixData);
    // lcd.clear();
    // lcd.setCursor(0, 0);
    // lcd.print(LcdMessage);
    // lcd.setCursor(0, 1);
    // lcd.print(“Updating…”);
    // //chage baudrate*

    * // sprintf(BTCommandBuffer, “AT+UART=9600,0,0\r\n”, subfixData);
    // Serial1.print(BTCommandBuffer);
    // delay(1000);
    // //chage HC05 name*

    * // sprintf(BTCommandBuffer, “AT+NAME=“1247-%s-%d”\r\n”, prefixData, subfixData);
    // Serial1.print(BTCommandBuffer);
    // subfixData++;
    // delay(1000);
    // //show message on LCD panel*

    * // lcd.clear();
    // lcd.setCursor(0, 0);
    // lcd.print(LcdMessage);
    // lcd.setCursor(0, 1); // 設定游標位置在第一行行首*

    * // lcd.print(“Done updating”);
    // } else {_

    // digitalWrite(LED_Y, LOW);
    _ // }
    // BTNTimeStamp = millis();
    // }
    // 若收到「序列埠監控視窗」的資料,則送到藍牙模組*

    * if (Serial.available()) {
    val = Serial.read();
    aRxBuffer[rxindex] = val;
    rxindex++;
    if (val == ‘\n’) {
    // Serial.print(aRxBuffer);
    rxindex = 0;
    if (strstr(aRxBuffer, “AT+PREFIX=”) != NULL)
    {
    Serial.print(“PREFIX OK\r\n”);
    memset(prefixData, 0, 20);
    memcpy(prefixData, aRxBuffer + 11, strlen(aRxBuffer) - 14); // “”\r\n +4*

    * // Serial.println(strlen(aRxBuffer)-12);
    Serial.println(prefixData);
    }
    else if (strstr(aRxBuffer, “AT+SUBFIX=”) != NULL)
    {
    Serial.print(“SUBFIX OK\r\n”);
    memcpy(BTName, aRxBuffer + 11, strlen(aRxBuffer) - 14); // “”\r\n +4*

    * sscanf( BTName, “%u”, &subfixData);
    Serial.println(subfixData);
    memset(BTName, 0, 40);
    }
    else if (strstr(aRxBuffer, “a”) != NULL)
    {
    sprintf(BTCommandBuffer, “AT\r\n”);
    Serial1.print(BTCommandBuffer);
    }
    else if (strstr(aRxBuffer, “b”) != NULL)
    {
    sprintf(BTCommandBuffer, “AT+\r\n”);
    Serial1.print(BTCommandBuffer);
    }
    else {
    Serial1.print(aRxBuffer);
    }
    memset(aRxBuffer, 0, 40);
    }
    // Serial1.print(val);
    }
    // 若收到藍牙模組的資料,則送到「序列埠監控視窗」
    if (Serial1.available()) {
    val = Serial1.read();
    Serial.print(val);
    aRxBuffer[rxindex] = val;
    rxindex++;
    if (val == ‘\n’) {
    rxindex = 0;
    switch (aRxBuffer[0]) {
    case ‘O’:
    if (aRxBuffer[1] == ‘K’)
    {
    // lcd.clear();
    lcd.setCursor(0, 1);
    lcd.print(“rOK”);
    Serial.println(“rOK”);
    }
    break;
    case ‘E’:
    // lcd.clear();
    lcd.setCursor(0, 1);
    lcd.print(“rERROR”);
    Serial.println(“rERROR”);
    break;
    }
    // if (aRxBuffer[0] == ‘O’)
    // if (aRxBuffer[1] == ‘K’) {
    // lcd.clear();
    // lcd.setCursor(0, 1);
    // lcd.print(“rOK”);
    // }
    // if (strstr(aRxBuffer, “OK”) != NULL)
    // {
    // lcd.clear();
    // lcd.setCursor(0, 1);
    // lcd.print(“rOK”);
    // } else if (strstr(aRxBuffer, “ERROR”) != NULL) {
    // lcd.clear();
    // lcd.setCursor(0, 1);
    // lcd.print(“rERROR”);
    // }
    memset(aRxBuffer, 0, 40);
    }
    }
    }*_

Why is your code in partially in italics?

Please edit your post and add

``` [code] ``` before your code

``` [/code] ``` after your code

That will prevent the forum software from interpreting code as normal tags (e.g. [i]) and makes it easier to read / copy for us.

// Edit The output window contains a lot more information; what you showed is only the last line or so. Place your mouse in the output window, scroll through the window and copy all orange text and past it here (again using code tags as shown above).

In [u]general[/u], the error messages can be followed from beginning to end; fix the first error, recompile, fix the new first error and recompile etc.

actually S4A is not detecting leonardo board via Bluetooth so i asked for actual firmware for board so i got this code from board manufacturer to update in board ...when i am comping this code then its showing this error.

//

#include <LiquidCrystal_I2C.h>
#include <Wire.h>
#include <EEPROM.h>
#define PIN_BUTTON_S3 A1
#define PIN_BUTTON_S4 A5
#define LED_R 10

#define LED_Y 13
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);  
unsigned long BTNTimeStamp;

char val;  
int rxindex = 0;
char aRxBuffer[40];
char BTName[40];
char prefixData[20] = {'B', 'T'};
int subfixData = 0;
char BTCommandBuffer[50];
char LcdMessage[16];
int S3Press = 0, S4Press = 0;
int updateBTStep = 0;
//EEPROM
char value = 0;
int addr = 0;
char BTnumber[5] = {'1', '2', '3'};
char readBTnumber[5];
void setup() {

  lcd.begin(16, 2);      
  lcd.backlight(); 
  delay(250);
  lcd.noBacklight(); 
  delay(250);
  lcd.backlight();
  lcd.setCursor(0, 0); 
  lcd.print("S3 to set BT");


  for (int i = 0; i < sizeof(readBTnumber); i++)
  {
    uint8_t s;
    s = EEPROM.read(i);
    if ((s != 0xFF) && (s != 0x00))
    {
      readBTnumber[i] = s;
    }
  }

  if (!((readBTnumber[0] == 0x00) || (readBTnumber[0] == 0xFF)))
  {
    sscanf( readBTnumber, "%u", &subfixData);
    // subfixData += 2;
    lcd.setCursor(0, 1); 
    lcd.print(subfixData);
    Serial.println(subfixData);
  }
  else {
    lcd.setCursor(0, 1); 
    lcd.print("no data");
    Serial.println("no data");
  }


  pinMode(PIN_BUTTON_S3, INPUT);
  pinMode(PIN_BUTTON_S4, INPUT);
  pinMode(LED_R, OUTPUT);

  pinMode(LED_Y, OUTPUT);
  BTNTimeStamp = millis();

  Serial.begin(9600);   
  Serial.println("BT is ready!");

  Serial1.begin(9600);   
}

void loop() {
  if (S3Press == 0)
  {
    if (digitalRead(PIN_BUTTON_S3) == HIGH) {
      S3Press = 1;
      BTNTimeStamp = millis();
      digitalWrite(LED_Y, HIGH);
   
      sprintf(LcdMessage, "1247-%s-%d", prefixData, subfixData);
      lcd.clear();
      lcd.setCursor(0, 0);
      lcd.print(LcdMessage);
      lcd.setCursor(0, 1);
      lcd.print("Updating...");
    } else if (digitalRead(PIN_BUTTON_S4) == HIGH) {
      BTNTimeStamp = millis();
      digitalWrite(LED_R, HIGH);
      S4Press = 1;

    }

  }


  if (millis() - BTNTimeStamp  >= 2000)
  {
    if (S3Press == 1)
    {
      switch (updateBTStep) {
      case 0:

        lcd.clear();
        lcd.setCursor(0, 0);
        lcd.print("set 38400");
        
        sprintf(BTCommandBuffer, "AT+UART=38400,0,0\r\n");
        
        Serial1.print(BTCommandBuffer);

        Serial.println("step 0");
        updateBTStep++;
        break;
      case 1:
        lcd.clear();
        lcd.setCursor(0, 0);
        sprintf(LcdMessage, "1247-%s-%d", prefixData, subfixData);
        lcd.print(LcdMessage);

        
        sprintf(BTCommandBuffer, "AT+NAME=\"1247-%s-%d\"\r\n", prefixData, subfixData);
        subfixData++;
        

        Serial1.print(BTCommandBuffer);
        Serial.println("step 1");
        updateBTStep = 0;
        S3Press = 0;
        digitalWrite(LED_Y, LOW);

        char saveBTNumber[5];
        sprintf(saveBTNumber, "%d", subfixData);

        for (int i = 0; i < strlen(saveBTNumber); i++)
        {
          uint8_t s;
          s = saveBTNumber[i];
          if ((s != 0xFF) || (s != 0x00))
          {
            EEPROM.write(i, saveBTNumber[i]);
          }
        }
        Serial.println(subfixData);
        Serial.println(saveBTNumber);

        break;
      }
      BTNTimeStamp = millis();
    } else if (S4Press == 1) {
      subfixData = 0;
      lcd.clear();
      lcd.setCursor(0, 0);
      lcd.print("set 0");
      BTNTimeStamp = millis();
      digitalWrite(LED_R, LOW);
      //---EEPROM clear all
      for (int i = 0 ; i < EEPROM.length() ; i++) {
        EEPROM.write(i, 0);
      }
      //---
      S4Press = 0;
    }
  }

 
  if (Serial.available()) {
    val = Serial.read();

    aRxBuffer[rxindex] = val;
    rxindex++;
    if (val == '\n') {
      // Serial.print(aRxBuffer);
      rxindex = 0;
      if (strstr(aRxBuffer, "AT+PREFIX=") != NULL)
      {
        Serial.print("PREFIX OK\r\n");
        memset(prefixData, 0, 20);
        memcpy(prefixData, aRxBuffer + 11, strlen(aRxBuffer) - 14); // ""\r\n +4
        // Serial.println(strlen(aRxBuffer)-12);
        Serial.println(prefixData);

      }
      else if (strstr(aRxBuffer, "AT+SUBFIX=") != NULL)
      {
        Serial.print("SUBFIX OK\r\n");
        memcpy(BTName, aRxBuffer + 11, strlen(aRxBuffer) - 14); // ""\r\n +4
        sscanf( BTName, "%u", &subfixData);
        Serial.println(subfixData);
        memset(BTName, 0, 40);

      }
      else if (strstr(aRxBuffer, "a") != NULL)
      {
        sprintf(BTCommandBuffer, "AT\r\n");
        Serial1.print(BTCommandBuffer);
      }
      else if (strstr(aRxBuffer, "b") != NULL)
      {
        sprintf(BTCommandBuffer, "AT+\r\n");
        Serial1.print(BTCommandBuffer);
      }
      else {

        Serial1.print(aRxBuffer);
      }

      memset(aRxBuffer, 0, 40);
    }

    
  }


  if (Serial1.available()) {
    val = Serial1.read();
    Serial.print(val);

    aRxBuffer[rxindex] = val;
    rxindex++;
    if (val == '\n') {
      rxindex = 0;
      switch (aRxBuffer[0]) {
      case 'O':
        if (aRxBuffer[1] == 'K')
        {
          // lcd.clear();
          lcd.setCursor(0, 1);
          lcd.print("rOK");
          Serial.println("rOK");
        }
        break;
      case 'E':
        // lcd.clear();
        lcd.setCursor(0, 1);
        lcd.print("rERROR");
        Serial.println("rERROR");

        break;
      }

    
      memset(aRxBuffer, 0, 40);
    }

  }
}



//

1

i got the problem

thank you