Go Down

Topic: exit status 1 (Read 180605 times) previous topic - next topic

markonjak

i also wanted to upload the code and got the same error
Can someone please help me?






#include "DHT.h"
#define DHTPIN 2    
#define DHTTYPE DHT11  
DHT dht(DHTPIN, DHTTYPE);

void setup() {
 Serial.begin(9600);
 Serial.println(F("DHTxx test!"));
 dht.begin();}

void loop() {

 delay(2000);
 float h = dht.readHumidity();
 float t = dht.readTemperature();
 float f = dht.readTemperature(true);
  if (isnan(h) || isnan(t) || isnan(f)) {
  Serial.println(F("Failed to read from DHT sensor!"));
  return;
 }


 float hif = dht.computeHeatIndex(f, h);
 float hic = dht.computeHeatIndex(t, h, false);

 Serial.print(F("Humidity: "));
 Serial.print(h);
 Serial.print(F("%  Temperature: "));
 Serial.print(t);
 Serial.print(F("°C "));
 Serial.print(f);
 Serial.print(F("°F  Heat index: "));
 Serial.print(hic);
 Serial.print(F("°C "));
 Serial.print(hif);
 Serial.println(F("°F"));
}

AWOL

Please post the full error message.

Please remember to use code tags when posting code.

elvon_blunden

#92
Mar 01, 2019, 02:32 pm Last Edit: Mar 01, 2019, 02:33 pm by elvon_blunden
Compiles for me on an Uno with no errors.

Maybe you don't have the DHT library?


qaisqais

can someone please help me. I don't know what the problem is with my ken sherrif code it says executing command exit status 1

pert

can someone please help me. I don't know what the problem is with my ken sherrif code it says executing command exit status 1
Please do this:
  • When you encounter an error, you'll see a button on the right side of the orange bar "Copy error messages" in the Arduino IDE (or the icon that looks like two pieces of paper at the top right corner of the black console window in the Arduino Web Editor). Click that button..
  • In a forum reply here, click on the reply field.
  • Click the </> button on the forum toolbar. This will add the forum's code tags markup to your reply.
  • Press "Ctrl + V". This will paste the error between the code tags.
  • Move the cursor outside of the code tags before you add any additional text to your reply.


If the text exceeds the forum's 9000 character limit, save it to a .txt file and post it as an attachment. If you click the "Reply" button here, you will see an "Attachments and other settings" link.

anonymous3_3

#include <TimeLib.h>

const int IR_Sensor1=33;
const int IR_Sensor2=34;

void setup() {
 pinMode(IR_Sensor1,INPUT);
 pinMode(IR_Sensor1,INPUT);
 Serial.begin(9600);

}

void loop()
{
if(digitalRead(IR_Sensor1)==HIGH)       
   {
   int h=now.second();
   }
 if(digitalRead(IR_Sensor1)==HIGH)
   {
   int h1=now.second();
   }
   int x=h-h1;
   int s=1000*x;
}





I AM HAVING A ERROR AS EXIT STATUS 1 . Please can anyone help me to figure out this error

AWOL

The compiler told you what the error was, and where.
But:
1) You chose not to share that.
2) You hijacked an unrelated thread.

Rens_K

error code exit status 1

i have made this for a door code lock
but it gives error code: exit status 1
what is wrong?
can somebody help?
thank you

*******************************************************

#include <Keypad.h>
#include <LiquidCrystal.h>
#include <Servo.h>

int displayscreen();//prototype
int keypress();//prototype
int unlockdoor();//prototype
int incorrect();//prototype
int torture1();//prototype
int torture2();//prototype
int unlockbuzz();//prototype
int counterbeep();//prototype

Servo myservo;
int pos=0; // LCD Connections
LiquidCrystal lcd(A0,A1,A2,A3,A4,A5);
const byte rows=4;
const byte cols=3;

char key[rows][cols]={
{'1','2','3'},
{'4','5','6'},
{'7','8','9'},
{'*','0','#'}
};
byte rowPins[rows]={1,2,3,4};
byte colPins[cols]={5,6,7};
Keypad keypad= Keypad(makeKeymap(key),rowPins,colPins,rows,cols);
char* password="4697";
int currentposition=0;
int buzz=8;
int openbutton=10;
int closebutton=11;
int invalidcount=12;

void setup()
{

displayscreen();
Serial.begin(9600);
pinMode(openbutton, INPUT);
pinMode(closebutton, INPUT);
pinMode(buzz, OUTPUT);
myservo.attach(9); //SERVO ATTACHED//

lcd.begin(16,2);

}

void loop()
{
if( currentposition==0)
{
displayscreen();

}
int l ;
char code=keypad.getKey();
if(code!=NO_KEY)
{
lcd.clear();
lcd.setCursor(0,0);
lcd.print("PASSWORD:");
lcd.setCursor(7,1);
lcd.print(" ");
lcd.setCursor(7,1);
for(l=0;l<=currentposition;++l)
{

lcd.print("*");
keypress();
}

if (code==password[currentposition])
{
++currentposition;
if(currentposition==4)
{

unlockdoor();
currentposition=0;

}

}

else
{
++invalidcount;
incorrect();
currentposition=0;

}
if(invalidcount==5)
{

++invalidcount;
torture1();

}
if(invalidcount==8)
{
torture2();
}

}

if (digitalRead(openbutton))
{
  myservo.write(pos);
  lcd.clear();
  lcd.setCursor(0,1);
  lcd.print("Access Allowed");
  digitalWrite(buzz, LOW);
  delay(1000);
  digitalWrite(buzz, HIGH);
  delay(1000);
  digitalWrite(buzz, LOW);
  delay(1000);
  digitalWrite(buzz, HIGH);
  delay(1000);
  digitalWrite(buzz, LOW);
  delay(1000);
  lcd.clear();
}

if (digitalRead(closebutton))
{
  myservo.write(pos);
  lcd.clear();
  lcd.setCursor(0,1);
  lcd.print("Password:");
  delay(2000);
  lcd.clear();
}


//*******************************************OPEN THE DOOR FUNCTION

void unlockdoor();
{
delay(900);

lcd.setCursor(0,0);
lcd.println(" ");
lcd.setCursor(0,1);
lcd.print("Access Allowed");
lcd.setCursor(1,1);
lcd.println("Welcome          ");
unlockbuzz();

for(pos = 180; pos>=0; pos-=5) // goes from 180 degrees to 0 degrees
{
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(5); // waits 15ms for the servo to reach the position
}
delay(2000);



delay(1000);
counterbeep();

delay(1000);

for(pos = 0; pos <= 180; pos +=5) // goes from 0 degrees to 180 degrees
{ // in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15);


currentposition=0;

lcd.clear();
displayscreen();

}
}

//**********************************WRONG CODE FUNCTION

void incorrect();
{
delay(500);
lcd.clear();
lcd.setCursor(1,0);
lcd.print("CODE INCORRECT");
lcd.setCursor(15,1);
lcd.println(" ");
lcd.setCursor(1,1);
lcd.println("TRY AGAIN        ");

digitalWrite(buzz, HIGH);
delay(3000);
digitalWrite(buzz,LOW);
lcd.clear();
displayscreen();
}
//****************************** CLEAR THE SCREEN!!!**********************//
void clearscreen();
{
lcd.setCursor(0,0);
lcd.println(" ");
lcd.setCursor(0,1);
lcd.println(" ");
lcd.setCursor(0,2);
lcd.println(" ");
lcd.setCursor(0,3);
lcd.println(" ");
}
//******************************KEYPRESS***********************************//
void keypress();
{



digitalWrite(buzz, HIGH);
delay(50);
digitalWrite(buzz, LOW);
}
//********************************DISPALAY FUNCTION!!!
void displayscreen();
{

lcd.setCursor(3,0);
lcd.println("ENTER CODE   ");

}
//*************************** ARM SERVO
void armservo();
{

for (pos=180;pos<=180;pos+=50)
{
myservo.write(pos);
delay(5);
}
delay(5000);

for(pos=180;pos>=0;pos-=50)
{
myservo.write(pos);
}

}
//********************************UNLOCK BUZZ***********************************//
void unlockbuzz();
{

digitalWrite(buzz, HIGH);
delay(80);
digitalWrite(buzz, LOW);
delay(80);
digitalWrite(buzz, HIGH);
delay(80);
digitalWrite(buzz, LOW);
delay(200);
digitalWrite(buzz, HIGH);
delay(80);
digitalWrite(buzz, LOW);
delay(80);
digitalWrite(buzz, HIGH);
delay(80);
digitalWrite(buzz, LOW);
delay(80);
}

//*******************************COUNTER BEEP*************************************//
void counterbeep();
{
delay(1200);


lcd.clear();
digitalWrite(buzz, HIGH);

lcd.setCursor(16,15);
lcd.println(" ");
lcd.setCursor(16,14);
lcd.println(" ");
lcd.setCursor(1,0);
delay(200);
lcd.println("GET IN WITHIN: ");

lcd.setCursor(1,1);
lcd.print("5");
delay(200);
lcd.clear();
lcd.setCursor(1,0);
lcd.println("GET IN WITHIN: ");
digitalWrite(buzz,LOW);
delay(1000);
//2
digitalWrite(buzz, HIGH);
lcd.setCursor(1,0);
lcd.println("GET IN WITHIN: ");
lcd.setCursor(1,1); //2
lcd.print("4");
delay(100);
lcd.clear();
lcd.setCursor(1,0);
lcd.println("GET IN WITHIN: ");
digitalWrite(buzz,LOW);
delay(1000);
//3
digitalWrite(buzz, HIGH);
lcd.setCursor(1,0);
lcd.println("GET IN WITHIN: ");
lcd.setCursor(1,1); //3
lcd.print("3");
delay(100);
lcd.clear();
lcd.setCursor(1,0);
lcd.println("GET IN WITHIN: ");
digitalWrite(buzz,LOW);
delay(1000);
//4
digitalWrite(buzz, HIGH);
lcd.setCursor(1,0);
lcd.println("GET IN WITHIN: ");
lcd.setCursor(1,1); //4
lcd.print("2");
delay(100);
lcd.clear();
lcd.setCursor(1,0);
lcd.println("GET IN WITHIN: ");
digitalWrite(buzz,LOW);
delay(1000);
//
digitalWrite(buzz, HIGH);
lcd.setCursor(1,1);
lcd.print("1");
delay(100);
lcd.clear();
lcd.setCursor(1,0);
lcd.println("GET IN WITHIN: ");
digitalWrite(buzz,LOW);
delay(1000);
//5
digitalWrite(buzz, HIGH);
delay(40);
digitalWrite(buzz,LOW);
delay(40);
digitalWrite(buzz, HIGH);
delay(40);
digitalWrite(buzz,LOW);
delay(40);
digitalWrite(buzz, HIGH);
delay(40);
digitalWrite(buzz,LOW);
delay(40);
digitalWrite(buzz, HIGH);
delay(40);
digitalWrite(buzz,LOW);
lcd.clear();
lcd.setCursor(1,0);
lcd.print("RE-LOCKING");
delay(500);
lcd.setCursor(11,0);
lcd.print(".");
delay(500);
lcd.setCursor(12,0);
lcd.print(".");
delay(500);
lcd.setCursor(13,0);
lcd.print(".");
delay(400);
lcd.clear();
lcd.setCursor(1,0);
lcd.print("LOCKED");
delay(440);
}

//*****************************TORTURE1****************************************//
void torture1();
{
delay(1000);
lcd.clear();
lcd.setCursor(2,0);
lcd.print("WAIT FOR ");
lcd.setCursor(5,1);
lcd.print("15 SECONDS");
digitalWrite(buzz, HIGH);
delay(15000);
digitalWrite(buzz, LOW);
lcd.clear();
lcd.setCursor(2,0);
lcd.print("LOL..");
lcd.setCursor(1,1);
lcd.print(" HOW WAS THAT??");
delay(3500);
lcd.clear();
}

//******************************TORTURE2*****************************************//
void torture2();
{
delay(1000);
lcd.setCursor(1,0);
lcd.print(" ");
lcd.setCursor(2,0);
lcd.print("EAR DRUMS ARE");
lcd.setCursor(0,1);
lcd.print(" PRECIOUS!! ");
delay(1500);
lcd.clear();
lcd.setCursor(1,0);
lcd.print(" WAIT FOR");
lcd.setCursor(4,1);
lcd.print(" 1 MINUTE");
digitalWrite(buzz, HIGH);
delay(55000);
counterbeep();
lcd.clear();
digitalWrite(buzz, LOW);
lcd.setCursor(2,0);
lcd.print("WANT ME TO");
lcd.setCursor(1,1);
lcd.print("REDICULE MORE??");
delay(2500);
lcd.clear();
lcd.setCursor(2,0);
lcd.print("Ha Ha Ha Ha");
delay(1700);
lcd.clear();
}
}


AWOL

Please:
1) see reply #96
2) don't hijack unrelated topics
3) remember to use code tags when posting code

DesertElk

Hello there,
     I've been doing some projects with my Arduino Leonardo and when doing a project for the LED chase effect I have been getting this error
 "exit status 1
Error compiling for board Arduino Leonardo." I have been on the forum and have tried some of the solutions that have been suggested but nothing has been working. One of the solutions suggested to turn on the Verbose output for compiling and uploading and it came up with this C:\Users\Caden\AppData\Local\Temp\ccjA0Rth.ltrans0.ltrans.o: In function `main':

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\cores\arduino/main.cpp:43: undefined reference to `setup'

collect2.exe: error: ld returned 1 exit status

I recognized several of these as file destinations and did my best to follow it but then I couldn't continue. I don't know if there is something missing from my library that I need to install and if there is, I can't say I know what I need. I appreciate any advice that can be given. Thank you

DesertElk

I apologize for not using the code quotation that is being asked for

pert

it came up with this C:\Users\Caden\AppData\Local\Temp\ccjA0Rth.ltrans0.ltrans.o: In function `main':

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\cores\arduino/main.cpp:43: undefined reference to `setup'
Every Arduino sketch must have a setup() and loop() function, even if they are left empty. Your sketch does not have a setup() function, thus the error.

DesertElk

Thank you so much, it is greatly appreciated

pert

You're welcome. I'm glad if I was able to be of assistance. Enjoy!
Per

Go Up