exit status 1

Could someone explain what a exit status 1 and compiling error is?

Thank you

Could someone explain what a exit status 1 and compiling error is?

An exit status of 1 means that there was a problem compiling, linking, or uploading some code.

The compiling error message means that the process didn't even make it past the compile step.

Now that I know this, What do I do? The sketch came with the robot I purchased.

Now that I know this, What do I do?

Fix the code. If you need help, print out a copy, and mail it to every forum member.

Or post it here.

The sketch came with the robot I purchased.

And, of course, you've selected that robot from the Tools + Board menu. Or is that a silly assumption?

If you’re using the Arduino IDE you should set your Preferences to verbose output for compile and upload. A description of the exact error will be present.

1 Like

Chagrin: If you're using the Arduino IDE you should set your Preferences to verbose output for compile and upload. A description of the exact error will be present.

^^^ Excellent tip, many thanks. I was getting the same exit status 1 error but changing the preferences as you suggested led me straight to the error in my code. It's also nice to see a detail about what exactly is happening during verify and compile. Kudos to you :-)

Every day's a school day...

Peace SK

I have the same problem - I am trying to get the Trinket to work a servo and am not sure what part of the coder is wrong. Here is the code which I copied off the Adafruit Soft Servo Library- Arduino Code | Trinket (& Gemma) Servo Control | Adafruit Learning System.

Can anyone help?

/*******************************************************************
SoftServo sketch for Adafruit Trinket. Turn the potentiometer knob
to set the corresponding position on the servo
(0 = zero degrees, full = 180 degrees)

Required library is the Adafruit_SoftServo library
available at GitHub - adafruit/Adafruit_SoftServo: A lightweight software servo library, designed for Trinket/Gemma but good for other Arduino-compats
The standard Arduino IDE servo library will not work with 8 bit
AVR microcontrollers like Trinket and Gemma due to differences
in available timer hardware and programming. We simply refresh
by piggy-backing on the timer0 millis() counter

Required hardware includes an Adafruit Trinket microcontroller
a servo motor, and a potentiometer (nominally 1Kohm to 100Kohm

As written, this is specifically for the Trinket although it should
be Gemma or other boards (Arduino Uno, etc.) with proper pin mappings

Trinket: USB+ Gnd Pin #0 Pin #2 A1
Connection: Servo+ - Servo1 Potentiometer wiper

*******************************************************************/

#include <Adafruit_SoftServo.h> // SoftwareServo (works on non PWM pins)

#define SERVO1PIN 0 // Servo control line (orange) on Trinket Pin #0

#define POTPIN 1 // Potentiometer sweep (center) on Trinket Pin #2 (Analog 1)

Adafruit_SoftServo myServo1, myServo2; //create TWO servo objects

void setup() {
// Set up the interrupt that will refresh the servo for us automagically
OCR0A = 0xAF; // any number is OK
TIMSK |= _BV(OCIE0A); // Turn on the compare interrupt (below!)

myServo1.attach(SERVO1PIN); // Attach the servo to pin 0 on Trinket
myServo1.write(90); // Tell servo to go to position per quirk
delay(15); // Wait 15ms for the servo to reach the position
}

void loop() {
int potValue; // variable to read potentiometer
int servoPos; // variable to convert voltage on pot to servo position
potValue=analogRead(POTPIN); // Read voltage on potentiometer
servoPos = map(potValue, 0, 1023, 0, 179); // scale it to use it with the servo (value between 0 and 180)
myServo1.write(servoPos); // tell servo to go to position

delay(15); // waits 15ms for the servo to reach the position
}

// We’ll take advantage of the built in millis() timer that goes off
// to keep track of time, and refresh the servo every 20 milliseconds
// The SIGNAL(TIMER0_COMPA_vect) function is the interrupt that will be
// Called by the microcontroller every 2 milliseconds
volatile uint8_t counter = 0;
SIGNAL(TIMER0_COMPA_vect) {
// this gets called every 2 milliseconds
counter += 2;
// every 20 milliseconds, refresh the servos!
if (counter >= 20) {
counter = 0;
myServo1.refresh();
}
}

Can anyone help?

The code either compiles or it doesn't. You haven't said which.

If it doesn't compile, there are some useful (to us, at least) error messages printed. You must share them (AND post your code correctly; yours is NOT posted correctly, but you could fix that).

If it does, the code does something when it runs. You haven't said what it does. You expect the code to do something. You haven't said what. All we know is that what it does is not what you want.

Asking for help is like asking for directions. You have to say where you are AND where you want to go and how you want to get there.

The code doesn't compile. I get the following error message:

exit status 1 Error compiling.

Not sure what to do.

What board are you compiling the code for?

Required hardware includes an Adafruit Trinket microcontroller

Is that what you have?

In reply #4 I stated it was necessary to turn on verbose messages for compile and upload to see more than just “exit status 1”. When you do that you will then see the appropriate error messages.

I faced a trouble that is about exit status 1 Error compiling
and this is my code

double Fahrenheit(double celsius)
{
return 1.8 * celsius + 32;
} //摄氏温度度转化为华氏温度

double Kelvin(double celsius)
{
return celsius + 273.15;
} //摄氏温度转化为开氏温度

// 露点(点在此温度时,空气饱和并产生露珠)
// 参考: http://wahiduddin.net/calc/density_algorithms.htm
double dewPoint(double celsius, double humidity)
{
double A0= 373.15/(273.15 + celsius);
double SUM = -7.90298 * (A0-1);
SUM += 5.02808 * log10(A0);
SUM += -1.3816e-7 * (pow(10, (11.344*(1-1/A0)))-1) ;
SUM += 8.1328e-3 * (pow(10,(-3.49149*(A0-1)))-1) ;
SUM += log10(1013.246);
double VP = pow(10, SUM-3) * humidity;
double T = log(VP/0.61078); // temp var
return (241.88 * T) / (17.558-T);
}

// 快速计算露点,速度是5倍dewPoint()
// 参考: http://en.wikipedia.org/wiki/Dew_point
double dewPointFast(double celsius, double humidity)
{
double a = 17.271;
double b = 237.7;
double temp = (a * celsius) / (b + celsius) + log(humidity/100);
double Td = (b * temp) / (a - temp);
return Td;
}

#include <dht11.h>

dht11 DHT11;

#define DHT11PIN 2

void setup()
{
Serial.begin(9600);
Serial.println("DHT11 TEST PROGRAM ");
Serial.print("LIBRARY VERSION: ");
Serial.println(DHT11LIB_VERSION);
Serial.println();
}

void loop()
{
Serial.println("\n");

int chk = DHT11.read(DHT11PIN);

Serial.print("Read sensor: ");
switch (chk)
{
case DHTLIB_OK:
Serial.println(“OK”);
break;
case DHTLIB_ERROR_CHECKSUM:
Serial.println(“Checksum error”);
break;
case DHTLIB_ERROR_TIMEOUT:
Serial.println(“Time out error”);
break;
default:
Serial.println(“Unknown error”);
break;
}

Serial.print("Humidity (%): ");
Serial.println((float)DHT11.humidity, 2);

Serial.print("Temperature (oC): ");
Serial.println((float)DHT11.temperature, 2);

Serial.print("Temperature (oF): ");
Serial.println(Fahrenheit(DHT11.temperature), 2);

Serial.print("Temperature (K): ");
Serial.println(Kelvin(DHT11.temperature), 2);

Serial.print("Dew Point (oC): ");
Serial.println(dewPoint(DHT11.temperature, DHT11.humidity));

Serial.print("Dew PointFast (oC): ");
Serial.println(dewPointFast(DHT11.temperature, DHT11.humidity));

delay(2000);
}

this is the error message :
Arduino: 1.6.8 Hourly Build 2016/01/27 03:44 (Windows 8.1), Board: “Arduino/Genuino Uno”

C:\arduino\arduino-nightly\arduino-builder -dump-prefs -logger=machine -hardware “C:\arduino\arduino-nightly\hardware” -tools “C:\arduino\arduino-nightly\tools-builder” -tools “C:\arduino\arduino-nightly\hardware\tools\avr” -built-in-libraries “C:\arduino\arduino-nightly\libraries” -libraries “C:\Users\myao\Documents\Arduino\libraries” -fqbn=arduino:avr:uno -ide-version=10608 -build-path “C:\Users\myao\AppData\Local\Temp\build7c2170f152866686a852d80e3d37c7cc.tmp” -warnings=none -prefs=build.warn_data_percentage=75 -verbose “C:\Users\myao\Documents\Tencent Files\445975469\FileRecv\dht11\dht11.ino”
C:\arduino\arduino-nightly\arduino-builder -compile -logger=machine -hardware “C:\arduino\arduino-nightly\hardware” -tools “C:\arduino\arduino-nightly\tools-builder” -tools “C:\arduino\arduino-nightly\hardware\tools\avr” -built-in-libraries “C:\arduino\arduino-nightly\libraries” -libraries “C:\Users\myao\Documents\Arduino\libraries” -fqbn=arduino:avr:uno -ide-version=10608 -build-path “C:\Users\myao\AppData\Local\Temp\build7c2170f152866686a852d80e3d37c7cc.tmp” -warnings=none -prefs=build.warn_data_percentage=75 -verbose “C:\Users\myao\Documents\Tencent Files\445975469\FileRecv\dht11\dht11.ino”
“C:\arduino\arduino-nightly\hardware\tools\avr/bin/avr-g++” -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10608 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR “-IC:\arduino\arduino-nightly\hardware\arduino\avr\cores\arduino” “-IC:\arduino\arduino-nightly\hardware\arduino\avr\variants\standard” “C:\Users\myao\AppData\Local\Temp\build7c2170f152866686a852d80e3d37c7cc.tmp\sketch\dht11.ino.cpp” -o “nul”
“C:\arduino\arduino-nightly\hardware\tools\avr/bin/avr-g++” -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10608 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR “-IC:\arduino\arduino-nightly\hardware\arduino\avr\cores\arduino” “-IC:\arduino\arduino-nightly\hardware\arduino\avr\variants\standard” “C:\Users\myao\AppData\Local\Temp\build7c2170f152866686a852d80e3d37c7cc.tmp\sketch\dht11.ino.cpp” -o “C:\Users\myao\AppData\Local\Temp\build7c2170f152866686a852d80e3d37c7cc.tmp\preproc\ctags_target_for_gcc_minus_e.cpp”
C:\Users\myao\Documents\Tencent Files\445975469\FileRecv\dht11\dht11.ino:1:19: fatal error: dht11.h: No such file or directory

#include <dht11.h>

^

compilation terminated.

exit status 1
Error compiling.

C:\Users\myao\Documents\Tencent Files\445975469\FileRecv\dht11\dht11.ino:1:19: fatal error: dht11.h: No such file or directory

Obviously you have not downloaded, or properly installed, or both, the dht11 library you are trying to use.

Did you mean DHT11.h ? Not the same as dht11.h

I am getting the same code, and I as well do not know what to do. I am trying to use my rotary encoder and pot to display on my lcd1602. I copied this code from somewhere on the interwebs.

#include <LiquidCrystal.h>
#include <RotaryEncoder.h>

LiquidCrystal lcd( 8 , 9 , 4 , 5 , 6 , 7);

RotaryEncoder encoder(10, 11);

int value = 0;

byte full[8] = {0b11111, 0b11111, 0b11111, 0b11111,
0b11111, 0b11111, 0b11111, 0b11111
};
byte one[8] = {0b11011, 0b10011, 0b11011, 0b11011,
0b11011, 0b11011, 0b10001, 0b11111
};
byte two[8] = {0b10001, 0b01110, 0b11110, 0b11101,
0b11011, 0b10111, 0b00000, 0b11111
};
byte three[8] = {0b00000, 0b11101, 0b11011, 0b11101,
0b11110, 0b01110, 0b10001, 0b11111
};
byte four[8] = {0b11101, 0b11001, 0b10101, 0b01101,
0b00000, 0b11101, 0b11101, 0b11111
};
byte five[8] = {0b00000, 0b01111, 0b00001, 0b11110,
0b11110, 0b01110, 0b10001, 0b11111
};
byte six[8] = {0b11001, 0b10111, 0b01111, 0b00001,
0b01110, 0b01110, 0b10001, 0b11111
};

static int pos = 1;
int newPos = 0;
int selected = 0;

void setup()
{

pinMode(12, INPUT_PULLUP);
pinMode(13,OUTPUT);
digitalWrite(13,HIGH);
lcd.begin(20, 4);
lcd.createChar(0, full);
lcd.createChar(1, one);
lcd.createChar(2, two);
lcd.createChar(3, three);
lcd.createChar(4, four);
lcd.createChar(5, five);
lcd.createChar(6, six);

lcd.setCursor(0, 0);
lcd.print(" 1 2 3 4 5 6 ");
lcd.setCursor(1, 2);
lcd.print("Present Value: ");
lcd.setCursor(1, 3);
lcd.print(“Selected: -”);
}

void loop()
{
value = digitalRead(12);
if (value == LOW)
{
lcd.setCursor(13, 3);
selected = newPos;
lcd.print(selected);
}
encoder.tick();
newPos = encoder.getPosition();
if (pos != newPos)
{

if (newPos > 6)
{
encoder.setPosition(6);
newPos = 6;
}

if (newPos < 1)
{
encoder.setPosition(1);
newPos = 1;
}

highlightedSelection(newPos);
pos = newPos;
}
}

void highlightedSelection(int count)
{

int present = (count * 3) - 1;
if (count > pos)
{
lcd.setCursor(present - 4, 0);
lcd.print(" “);
lcd.print(count - 1);
lcd.print(” “);
}
if (count < pos)
{
lcd.setCursor(present + 2, 0);
lcd.print(” “);
lcd.print(count + 1);
lcd.print(” ");
}

lcd.setCursor(present - 1, 0);
lcd.write((uint8_t)0);
lcd.write((uint8_t)0);
lcd.write((uint8_t)0);

lcd.setCursor(present, 0);
lcd.write((uint8_t)count);

lcd.setCursor(15, 2);
lcd.print(count);
}

The full error message is

Arduino: 1.6.9 (Windows 10), Board: “Arduino/Genuino Uno”

C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware “C:\Program Files (x86)\Arduino\hardware” -tools “C:\Program Files (x86)\Arduino\tools-builder” -tools “C:\Program Files (x86)\Arduino\hardware\tools\avr” -built-in-libraries “C:\Program Files (x86)\Arduino\libraries” -libraries “C:\Users\lilfe\Documents\Arduino\libraries” -fqbn=arduino:avr:uno -vid-pid=0X2341_0X0043 -ide-version=10609 -build-path “C:\Users\lilfe\AppData\Local\Temp\buildef25991c618f0ae6f5a1d498184f8cbc.tmp” -warnings=none -prefs=build.warn_data_percentage=75 -verbose “C:\Users\lilfe\Documents\Arduino\sketch_jun08a\sketch_jun08a.ino”
C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware “C:\Program Files (x86)\Arduino\hardware” -tools “C:\Program Files (x86)\Arduino\tools-builder” -tools “C:\Program Files (x86)\Arduino\hardware\tools\avr” -built-in-libraries “C:\Program Files (x86)\Arduino\libraries” -libraries “C:\Users\lilfe\Documents\Arduino\libraries” -fqbn=arduino:avr:uno -vid-pid=0X2341_0X0043 -ide-version=10609 -build-path “C:\Users\lilfe\AppData\Local\Temp\buildef25991c618f0ae6f5a1d498184f8cbc.tmp” -warnings=none -prefs=build.warn_data_percentage=75 -verbose “C:\Users\lilfe\Documents\Arduino\sketch_jun08a\sketch_jun08a.ino”
“C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++” -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10609 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR “-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino” “-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard” “C:\Users\lilfe\AppData\Local\Temp\buildef25991c618f0ae6f5a1d498184f8cbc.tmp\sketch\sketch_jun08a.ino.cpp” -o “nul”
“C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++” -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10609 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR “-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino” “-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard” “-IC:\Program Files (x86)\Arduino\libraries\LiquidCrystal\src” “C:\Users\lilfe\AppData\Local\Temp\buildef25991c618f0ae6f5a1d498184f8cbc.tmp\sketch\sketch_jun08a.ino.cpp” -o “nul”
“C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++” -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10609 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR “-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino” “-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard” “-IC:\Program Files (x86)\Arduino\libraries\LiquidCrystal\src” “C:\Users\lilfe\AppData\Local\Temp\buildef25991c618f0ae6f5a1d498184f8cbc.tmp\sketch\sketch_jun08a.ino.cpp” -o “C:\Users\lilfe\AppData\Local\Temp\buildef25991c618f0ae6f5a1d498184f8cbc.tmp\preproc\ctags_target_for_gcc_minus_e.cpp”
C:\Users\lilfe\Documents\Arduino\sketch_jun08a\sketch_jun08a.ino:2:27: fatal error: RotaryEncoder.h: No such file or directory

#include <RotaryEncoder.h>

^

compilation terminated.

Using library LiquidCrystal at version 1.0.5 in folder: C:\Program Files (x86)\Arduino\libraries\LiquidCrystal
exit status 1
Error compiling for board Arduino/Genuino Uno.

If understanding this message:

C:\Users\lilfe\Documents\Arduino\sketch_jun08a\sketch_jun08a.ino:2:27: fatal error: RotaryEncoder.h: No such file or directory

is too difficult for you, you are not ready to own an Arduino.

i have the same problem with this code

// Create an instance of the DRV8833: DRV8833 driver = DRV8833();

// Pin numbers. Replace with your own! // For this example sketch, these pin numbers MUST be PWM. // Attach the Arduino’s pin numbers below to the // Ain1, Ain2, Bin1, and Bin2 DRV8833 pins. const int inputA1 = 9, inputA2 = 6;

// The speed of the motors: const int motorSpeedHigh = 255; const int motorSpeedLow = 64; int myDelay = 4000;

void setup() { // put your setup code here, to run once:

// Start the serial port: Serial.begin(9600);

// Wait for the serial port to connect. Needed for Leonardo. while (!Serial);

// Attach the motors to the input pins: driver.attachMotorA(inputA1, inputA2); Serial.println(“Ready!”); }

void loop() { Serial.println(“Forward:”); driver.motorAForward(motorSpeedHigh); delay(myDelay); driver.motorAStop();

driver.motorAForward(motorSpeedLow); delay(myDelay); driver.motorAStop();

Serial.println(“Reverse:”); driver.motorAReverse(motorSpeedHigh); delay(myDelay); driver.motorAStop();

driver.motorAReverse(motorSpeedLow); delay(myDelay); driver.motorAStop(); }

i have the same problem with this code

I downloaded the library, and fixed the stupid mistakes in it.

In the header file:

private:
	// Fields for the class:
	int a1, a2, b1, b2;
	boolean motorAAttached;
	boolean motorBAttached;

Member variables can NOT be initialized in the header file.

In the source file:

DRV8833::DRV8833()
{
	// Does nothing.
	// Use attachMotorA() and attachMotorB().
	motorAAttached = false;
	motorBAttached = false;
}

They should be initialized when the constructor is called.

In your sketch,

DRV8833 driver = DRV8833();

is nonsense. One NEVER invokes the constructor directly. It is invoked ONLY by new or indirectly, by creating an instance.

DRV8833 driver;

But, of course, the compiler has no idea what a DRV8833 is, if you don’t include the appropriate header file.

#include <DRV8833.h>

After that, I get:

Binary sketch size: 3,136 bytes (of a 30,720 byte maximum)

hi sir, i tried to up load the program temperature and humidity sensor.but error came like bellow

compilation terminated.

exit status 1 Error compiling for board Arduino/Genuino Uno.

please tell me the solution.

please tell me the solution.

Fix the errors that cause the program to fail to compile or link.

If you need help doing that, examine your post carefully. See if YOU can find any code. See if you can find which version of the IDE you are using. See if you can find which board you are using. I certainly can't find ANY useful information in your post.