Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 2 of 2

Thread: Error Compiling for Arduino/Genuino

  1. #1
    Junior Member
    Join Date
    Apr 2019
    Posts
    8

    Error Compiling for Arduino/Genuino

    When trying to verify this code in Arduino, I keep getting this error message "Error Compiling for Arduino/Genuino exit status 1" the code is shown below

    #include <VirtualWire.h>
    #include <Servo.h>
    // Declare Sevor Objects
    Servo string1;
    Servo string2;
    Servo string3;
    Servo string4;
    Servo string5;
    // Declare signal inputs
    int pressure_signal1;
    int pressure_signal2;
    int pressure_signal3;
    int pressure_signal4;
    int pressure_signal5;
    // Callibrated MIN MAX valuse for the flex resistors
    int P1MIN=0;
    int P1MAX=1000;
    int P2MIN=0;
    int P2MAX=1000;
    int P3MIN=0;
    int P3MAX=1000;
    int P4MIN=0;
    int P4MAX=1000;
    int P5MIN=0;
    int P5MAX=1000;
    //Setup
    void setup() {
    Serial.begin(9600);
    string1.attach(9);
    string2.attach(10);
    string3.attach(11);
    string4.attach(12);
    string5.attach(13);

    vw_set_ptt_inverted(true); // Required for RF Link module
    vw_setup(400); // 400 Bits per sec
    vw_set_tx_pin(12); // pin 12 is used as the transmit data out into the TX Link module
    vw_set_rx_pin(11); // pin 11 is used as the transmit data out into the TX Link
    vw_rx_start(); // Start the receiver
    }
    void loop() {
    // Buffer that holds the data received
    uint8_t buf[VW_MAX_MESSAGE_LEN];
    uint8_t buflen = VW_MAX_MESSAGE_LEN;
    // check to see if anything has been received
    if (vw_get_message(buf, &buflen)) {

    // Data trimming
    pressure_signal1 = constrain(buf[0], P1MIN, P1MAX);
    pressure_signal2 = constrain(buf[2], P2MIN, P2MAX);
    pressure_signal3 = constrain(buf[4], P3MIN, P3MAX);
    pressure_signal4 = constrain(buf[6], P4MIN, P4MAX);
    pressure_signal5 = constrain(buf[8], P5MIN, P5MAX);
    // Maps the values from the flex resistor to control signals of the motor
    int pullFinger1 = map(pressure_signal1, P1MIN, P1MAX, 0, 180);
    int pullFinger2 = map(pressure_signal2, P2MIN, P2MAX, 180, 0);
    int pullFinger3 = map(pressure_signal3, P3MIN, P3MAX, 0, 180);
    int pullFinger4 = map(pressure_signal4, P4MIN, P4MAX, 180, 0);
    int pullFinger5 = map(pressure_signal5, P5MIN, P5MAX, 0, 180);


    string1.write(pullFinger1);
    string2.write(pullFinger2);
    string3.write(pullFinger3);
    string4.write(pullFinger4);
    string5.write(pullFinger5);
    //Monitor values through serial monitos
    Serial.print("pressure1: ");
    Serial.print(pressure_signal1);
    Serial.print(" pressure2: ");
    Serial.print(pressure_signal2);
    Serial.print("pressure3: ");
    Serial.print(pressure_signal3);
    Serial.print(" pressure4: ");
    Serial.print(pressure_signal4);
    Serial.print("pressure5: ");
    Serial.print(pressure_signal5);
    Serial.print(" motor1: ");
    Serial.print(pullFinger1);
    Serial.print(" motor2: ");
    Serial.println(pullFinger2);
    Serial.print(" motor3: ");
    Serial.print(pullFinger3);
    Serial.print(" motor4: ");
    Serial.println(pullFinger4);
    Serial.print(" motor5: ");
    Serial.print(pullFinger5);
    }
    }

  2. #2
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    4,898
    Duplicate Thread.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •