Go Down

Topic: Error: "exit status 1" (Read 419 times) previous topic - next topic

MatzHilven

Hello, I wrote a program for my Pololu Zumo, and I get this error. Can someone help me with this?
Thanks

Code:
Code: [Select]

#include <Wire.h>
#include <ZumoShield.h>

#define LED_PIN 13

ZumoMotors motors;

const uint16_t motorSpeed = 300;

void loop() {

    Pushbutton button(ZUMO_BUTTON);

    // Move forward for two seconds
    motors.setSpeeds(motorSpeed, motorSpeed);
    delay(2000);

    // Stop and pause
    motors.setSpeeds(0, 0);
    delay(500);

    // Move backwards two seconds
    motors.setSpeeds(-motorSpeed, -motorSpeed);
    delay(2000);

    // Stop
    motors.setSpeeds(0, 0);
    delay(500);

    // Turn left
    motors.setSpeeds(-motorSpeed, motorSpeed);
    delay(1000);   

    // Stop
    motors.setSpeeds(0, 0);
  }


Error:
Code: [Select]

C:\Users\FRANK\AppData\Local\Temp\cc9u5Wfm.ltrans0.ltrans.o: In function `main':

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/main.cpp:43: undefined reference to `setup'

collect2.exe: error: ld returned 1 exit status

Multiple libraries were found for "Wire.h"
 Used: C:\Program
Multiple libraries were found for "ZumoShield.h"
 Used: C:\Users\FRANK\Documents\Arduino\libraries\ZumoShield
exit status 1
Error compiling for board Arduino/Genuino Uno.

slipstick

As the message says you don't have a setup() function. You need one. If there's really nothing you want to do when the program first starts up just include:
Code: [Select]

void setup() {}


Steve

Go Up