Go Down

Topic: Exit status 1, Error compiling for board Arduino/Genuino Uno. [Solved!] (Read 194935 times) previous topic - next topic

sterretje

@MyNameIsNoukane

It looks like you're directly opening the ino file from within the zip file; I might be wrong. Not sure if that will work.

If you're indeed opening the ino file in the zip file, extract the zip file to a directory of choice first and next open the ino file in that directory; next compile.
If you understand an example, use it.
If you don't understand an example, don't use it.

Electronics engineer by trade, software engineer by profession. Trying to get back into electronics after 15 years absence.

Kavin-v-s

#include
int RECV_PIN = 3;
IRrecv irrecv(RECV_PIN);
decode-results results;
void setup()
{
Serial.begin(9600);
irrecv.enableIRIn();
pinMode(13,OUTPUT);
}
void loop()
{
if (irrecv.decode(&results)) {// irrecv.decode(&results)
Serial.println(results.value, HEX);
if(results.value==0xFA08F7)
{
digitalWrite(13,HIGH);
else
digitalWrite(13,LOW);
delay(300);
irrecv.resume ();
}
}




Exit status 1
Error compiling for board arduino/genuino uno

PaulS

The art of getting good answers lies in asking good questions.

kstorn

not sure why

 but I removed the in-line comments and now I can compile.

dglnk

Guys,
I'm a newbie and trying to do a home-security system for school project. I did research on the internet an found a site with subject. Unfortunately, when I tried to run mine, I keep getting compile error (exit 1). I went line by line and could not find anything.
Can you pleas help? Thank you in advance.



#include <Keypad.h>
#include<LiquidCrystal.h>
#include<EEPROM.h>
LiquidCrystal lcd(9, 8, 7, 6, 5, 4);
char password[4];
char pass[4], pass1[4];
int i = 0;
char customKey = 0;
const byte ROWS = 4; //four rows
const byte COLS = 4; //four columns
char hexaKeys[ROWS][COLS] = {
  {'1', '2', '3', 'A'},
  {'4', '5', '6', 'B'},
  {'7', '8', '9', 'C'},
  {'*', '0', '#', 'D'}
};
byte rowPins[ROWS] = {A0, A1, A2, A3}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {A4, A5, 3, 2}; //connect to the column pinouts of the keypad
//initialize an instance of class NewKeypad
Keypad customKeypad = Keypad( makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS);
int led;
int buzzer = 10;
int m11;
int m12;
void setup()
{
  Serial.begin(9600);
  pinMode(11, OUTPUT);

  lcd.begin(16, 2);
  pinMode(led, OUTPUT);
  pinMode(buzzer, OUTPUT);
  pinMode(m11, OUTPUT);
  pinMode(m12, OUTPUT);
  lcd.print(" Electronic ");
  Serial.print(" Electronic ");
  lcd.setCursor(0, 1);
  lcd.print(" Keypad Lock ");
  Serial.print(" Keypad Lock ");
  delay(2000);
  lcd.clear();
  lcd.print("Enter Ur Passkey:");
  Serial.println("Enter Ur Passkey:");
  lcd.setCursor(0, 1);
  for (int j = 0; j < 4; j++)
    EEPROM.write(j, j + 49);
  for (int j = 0; j < 4; j++)
    pass[j] = EEPROM.read(j);
}

void loop()
{
  digitalWrite(11, HIGH);
  customKey = customKeypad.getKey();
  if (customKey == '#')
    change();
  if (customKey)
  {
    password[i++] = customKey;
    lcd.print(customKey);
    Serial.print(customKey);
    beep();
  }
  if (i == 4)
  {
    delay(200);
    for (int j = 0; j < 4; j++)
      pass[j] = EEPROM.read(j);
    if (!(strncmp(password, pass, 4)))
    {
      digitalWrite(led, HIGH);
      beep();
      lcd.clear();
      lcd.print("Passkey Accepted");
      Serial.println("Passkey Accepted");
      digitalWrite(11, LOW);
      delay(2000);
      lcd.setCursor(0, 1);
      lcd.print("#.Change Passkey");
      Serial.println("#.Change Passkey");
      delay(2000);
      lcd.clear();
      lcd.print("Enter Passkey:");
      Serial.println("Enter Passkey:");
      lcd.setCursor(0, 1);
      i = 0;
      digitalWrite(led, LOW);
    }
    else
    {
      digitalWrite(11, HIGH);
      digitalWrite(buzzer, HIGH);
      lcd.clear();
      lcd.print("Access Denied...");
      Serial.println("Access Denied...");
      lcd.setCursor(0, 1);
      lcd.print("#.Change Passkey");
      Serial.println("#.Change Passkey");
      delay(2000);
      lcd.clear();
      lcd.print("Enter Passkey:");
      Serial.println("Enter Passkey:");
      lcd.setCursor(0, 1);
      i = 0;
      digitalWrite(buzzer, LOW);
    }
  }
}
void change()
{
  int j = 0;
  lcd.clear();
  lcd.print("UR Current Passk");
  Serial.println("UR Current Passk");
  lcd.setCursor(0, 1);
  while (j < 4)
  {
    char key = customKeypad.getKey();
    if (key)
    {
      pass1[j++] = key;
      lcd.print(key);
      Serial.print(key);
      beep();
    }
    key = 0;
  }
  delay(500);

  if ((strncmp(pass1, pass, 4)))
  {
    lcd.clear();
    lcd.print("Wrong Passkey...");
    Serial.println("Wrong Passkey...");
    lcd.setCursor(0, 1);
    lcd.print("Better Luck Again");
    Serial.println("Better Luck Again");
    delay(1000);
  }
  else
  {
    j = 0;
    lcd.clear();
    lcd.print("Enter New Passk:");
    Serial.println("Enter New Passk:");
    lcd.setCursor(0, 1);
    while (j < 4)
    {
      char key = customKeypad.getKey();
      if (key)
      {
        pass[j] = key;
        lcd.print(key);
        Serial.print(key);
        EEPROM.write(j, key);
        j++;
        beep();
      }
    }
    lcd.print(" Done......");
    Serial.println(" Done......");
    delay(1000);
  }
  lcd.clear();
  lcd.print("Enter Ur Passk:");
  Serial.println("Enter Ur Passk:");
  lcd.setCursor(0, 1);
  customKey = 0;
}
void beep()
{
  digitalWrite(buzzer, HIGH);
  delay(20);
  digitalWrite(buzzer, LOW);
}

ChrisTenone

dglnk,

Generally folks here are glad to help with school projects, but you should start a new thread that just focusses on your project. It was GREAT that you posted your code, but there is a better way to do that. Please read the "asking-for-help" guidelines in the thread called "How to use this forum - please read.". That way your project will attract the best, and most encouraging help.

Good luck, and welcome to the forum!
What, I need to say something else too?

UKHeliBob

Quote
I keep getting compile error (exit 1).
There is almost certainly more to the error message than that

When I compile it for a Uno using IDE 1.5.6-r2 on Windows 7 the only message that I get is
Code: [Select]

Sketch uses 6,822 bytes (21%) of program storage space. Maximum is 32,256 bytes.
Global variables use 596 bytes (29%) of dynamic memory, leaving 1,452 bytes for local variables. Maximum is 2,048 bytes.

in other words, no error
Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

Not_too_pro

use Ctrl-T in the IDE to reformat your code into a standard style.
Thanks. It really helped me in another code thought.

smorgil

look i have the same proplem can someone please help me?


//Use pushbotton as a toggle switch.

//When the pushbotton is pressed, the pushbotton pin reads a
//high voltage and then a low voltage, and then ledOn is set
//to the opposite of its current value (either false or true).

//Based on Starter Kit Project 02.
#include "pitches.h"

const int piezoPin = 12; //piezo
const int rPin = 5;  //red LED
const int gPin = 4;  //green LED
const int bPin = 3;  //blue LED
const int pPin = 2;  //pushbutton

int ledState = 0;
int ledOn = false;

// notes
int melody[] = {
  NOTE_F5,NOTE_D5,NOTE_AS4,NOTE_D5,NOTE_F5,NOTE_AS5,NOTE_D6,NOTE_C6,NOTE_AS5,NOTE_D5,NOTE_E5,NOTE_F5,
  NOTE_F5,NOTE_F5,NOTE_D6,NOTE_C6,NOTE_AS5,NOTE_A5,NOTE_G5,NOTE_A5,NOTE_AS5,NOTE_AS5,NOTE_F5,NOTE_D5,NOTE_AS4,
  NOTE_D6,NOTE_D6,NOTE_D6,NOTE_DS6,NOTE_F6,NOTE_F6,NOTE_DS6,NOTE_D6,NOTE_C6,NOTE_D6,NOTE_DS6,NOTE_DS6,
  0,NOTE_DS6,NOTE_D6,NOTE_C6,NOTE_AS5,NOTE_A5,NOTE_G5,NOTE_A5,NOTE_AS5,NOTE_D5,NOTE_E5,NOTE_F5,
  NOTE_F5,NOTE_AS5,NOTE_AS5,NOTE_AS5,NOTE_A5,NOTE_G5,NOTE_G5,NOTE_G5,NOTE_C6,NOTE_DS6,NOTE_D6,NOTE_C6,NOTE_AS5,NOTE_AS5,NOTE_A5,
  NOTE_F5,NOTE_F5,NOTE_AS5,NOTE_C6,NOTE_D6,NOTE_DS6,NOTE_F6,NOTE_AS5,NOTE_C6,NOTE_D6,NOTE_DS6,NOTE_C6,NOTE_AS5
};

// durations: 2 = half note, and 8/3,4,6,8,12. It appears that 8/2.9 is more accurate than 8/3.
float noteDurations[] = {
  6,12,4,4,4,2,6,12,4,4,4,2,
  8,8,8/2.9,8,4,2,8,8,4,4,4,4,4,
  6,12,4,4,4,2,8,8,4,4,4,2,
  8,8,8/2.9,8,4,2,8,8,4,4,4,2,
  4,4,4,8,8,4,4,4,4,8,8,8,8,4,4,
  8,8,8/2.9,8,8,8,2,8,8,4,4,4,2
};

// calculates the number of elements in the melody array.
int musicLength=sizeof(melody)/sizeof('NOTE_F5');

void setup() { 
  pinMode(pPin, INPUT);
  pinMode(rPin, OUTPUT);
  pinMode(gPin, OUTPUT);
  pinMode(bPin, OUTPUT);
}

void loop() {
  int pPinState=digitalRead(pPin);
  if(pPinState==HIGH) {
    ledState = 1;
  }
  if (pPinState==LOW and ledState ==1) {
    ledState = 2;
    ledOn = not ledOn;
  }
  if (ledOn && pPinState!=HIGH) {
    for (int thisNote = 0; thisNote < musicLength; thisNote++) {
      // blink the three LEDs in sequence
      if (thisNote%3==0){   
        digitalWrite(rPin, HIGH);
        digitalWrite(gPin, LOW);
        digitalWrite(bPin, LOW);
      }
      else if (thisNote%3==1){   
        digitalWrite(rPin, LOW);
        digitalWrite(gPin, HIGH);
        digitalWrite(bPin, LOW);
      }
      else if (thisNote%3==2){   
        digitalWrite(rPin, LOW);
        digitalWrite(gPin, LOW);
        digitalWrite(bPin, HIGH);
      }

      // calculate the note duration. change tempo by changing 2000 to other values
      int noteDuration = 2000/noteDurations[thisNote];
      tone(piezoPin, melody[thisNote],noteDuration);
     
      // to distinguish the notes, set a minimum time between them.
      // the note's duration + 30% seems to work well
      float pauseBetweenNotes = noteDuration * 1.30;
     
      //split the delay into two parts and check to see
      //whether the pushbutton is pressed to turn off
      //the sound and light
      delay(pauseBetweenNotes/2);
      if(digitalRead(pPin)==HIGH) {
        break;     
      }
      delay(pauseBetweenNotes/2);
      if(digitalRead(pPin)==HIGH) {
        break;     
      }
    }
  }
  else if (not ledOn) {
    digitalWrite(rPin, LOW);
    digitalWrite(gPin, LOW);
    digitalWrite(bPin, LOW);
  }
}

UKHeliBob

Quote
look i have the same proplem can someone please help me?
What problem would that be ?
Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

econjack

What problem would that be ?
One of his problems is that he didn't read the earlier post that asks posters to read Nick Gammon's How To Use This Site post at the top of the Forum, or using code tags to post their code.

ChrisTenone

I don't know of a help for that problem though.

Doesn't that same post say to start yer own thread, rather than just hijack one (especially if it says "solved", cause then nobody will read it.)
What, I need to say something else too?

alnpckr

Why am I getting error compiling for arduino/genuino uno*// NeoPixel Ring simple sketch (c) 2013 Shae Erisson
// released under the GPLv3 license to match the rest of the AdaFruit NeoPixel library

#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
  #include <avr/power.h>
#endif

// Which pin on the Arduino is connected to the NeoPixels?
// On a Trinket or Gemma we suggest changing this to 1
#define PIN            6

// How many NeoPixels are attached to the Arduino?
#define NUMPIXELS      24

// When we setup the NeoPixel library, we tell it how many pixels, and which pin to use to send signals.
// Note that for older NeoPixel strips you might need to change the third parameter--see the strandtest
// example for more information on possible values.
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);

int delayval = 500; // delay for half a second

void setup() {
  // This is for Trinket 5V 16MHz, you can remove these three lines if you are not using a Trinket
#if defined (__AVR_ATtiny85__)
  if (F_CPU == 16000000) clock_prescale_set(clock_div_1);
#endif
  // End of trinket special code

  pixels.begin(); // This initializes the NeoPixel library.
}

void loop() {

  // For a set of NeoPixels the first NeoPixel is 0, second is 1, all the way up to the count of pixels minus one.

  for(int i=0;i<NUMPIXELS;i++){

    // pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
    pixels.setPixelColor(i, pixels.Color(0,150,0)); // Moderately bright green color.

    pixels.show(); // This sends the updated pixel color to the hardware.

    delay(delayval); // Delay for a period of time (in milliseconds).

  }
}

*/

void setup() {
   
}

void loop() {
   
}

UKHeliBob

2 setup() and 2 loop() functions will cause a problem to start with

and what is this all about ?
Code: [Select]
*/
Seems like a block comment went wrong
Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

ChrisTenone

2 setup() and 2 loop() functions will cause a problem to start with

and what is this all about ?
Code: [Select]
*/
Seems like a block comment went wrong
But, but Bob!  This is the reading comprehension thread!
What, I need to say something else too?

Go Up