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

Thread: Error Compiling for Arduino/Genuino

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

    Error Compiling for Arduino/Genuino

    I am new to Arduino, when trying to execute this program I am getting the following error message. I am using Arduino 1.8.9. I need the code for Arduino. Here is the error message:

    libraries\Servo\avr\Servo.cpp.o (symbol from plugin): In function `ServoCount':

    (.text+0x0): multiple definition of `__vector_11'

    libraries\VirtualWire\VirtualWire.cpp.o (symbol from plugin).text+0x0): first defined here

    collect2.exe: error: ld returned 1 exit status

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


    Here is the code I am using

    #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_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
    Join Date
    Nov 2012
    Posts
    1,089
    If you need the code for Arduino, why are you asking about it on the Teensy forum? Again.

    Pete

  3. #3
    Administrator Paul's Avatar
    Join Date
    Oct 2012
    Posts
    332
    No more duplicate threads. You have been warned. If you keep create any more duplicate threads with this same code, you will be permanently banned from this forum.

    Ask for help with this code *only* on your original thread.
    https://forum.pjrc.com/threads/55918...rduino-Genuino

    This is you LAST warning. If you create another duplicate question, you will be banned.

Posting Permissions

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