Problem with multiple libraries weird error?

I am using more the servo library and the library from Virtual wire. I want to receive a message and then get a servo to move. I used this code:

#include <VirtualWire.h>
#include <Servo.h>

const int RIGHTWHEEL = 12;
const int LEFTWHEEL = 11;
Servo leftWheel;
Servo rightWheel;

void setup()
{
    Serial.begin(9600);	  // Debugging only
    Serial.println("setup");

    vw_setup(2000);	 // Bits per sec
    vw_set_rx_pin(22); 
    vw_rx_start();
}

void loop()
{
 uint8_t buf[VW_MAX_MESSAGE_LEN];
  uint8_t buflen = VW_MAX_MESSAGE_LEN;
  if(vw_get_message(buf, &buflen)) {
  if(buf[0] = 'f') {
    leftWheel.write(88);
    rightWheel.write(98);
  }
  }
}

I received this error:
Servo\Servo.cpp.o: In function __vector_17': C:\Users\brand_000\Desktop\arduino-1.0.5\libraries\Servo/Servo.cpp:103: multiple definition of __vector_17'
VirtualWire\VirtualWire.cpp.o:C:\Users\brand_000\Desktop\arduino-1.0.5\libraries\VirtualWire/VirtualWire.cpp:588: first defined here
c:/users/brand_000/desktop/arduino-1.0.5/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/bin/ld.exe: Disabling relaxation: it will not work with multiple definitions
I read somewhere that I need to put "#include <"Bounce">" but it didn't work and I couldn't find anywhere with the same error when I googled it and looked on the forum.
Thanks.

You can't use both libraries at the same time, they both use timer1. If you want to use a servo, then you will need to get this chip

I made a library that is easy to use, let me know when you get the chip and post the library.

I will consider it for the long term but do you know about the library servoTimer2? I downloaded it and I have a lot of errors? I would get the chip but I have no time.

What errors are you getting, post everything.

I fixed them but now I can't get my code to work but it compiles.
Receiver

#include <VirtualWire.h>
#include <ServoTimer2.h>
 
 #define lWheelpin 10
 #define rWheelpin 12;

ServoTimer2 leftWheel;
ServoTimer2 rightWheel;

void setup()
{
    Serial.begin(9600);	  // Debugging only
    Serial.println("setup");
    leftWheel.attach(10);
    rightWheel.attach(12);
    vw_setup(2000);	 // Bits per sec
    vw_set_rx_pin(5); 
    vw_rx_start();
}

void loop()
{
 uint8_t buf[VW_MAX_MESSAGE_LEN];
  uint8_t buflen = VW_MAX_MESSAGE_LEN;
  if(vw_get_message(buf, &buflen)) {
  if(buf[0] = 'f') {
    leftWheel.write(88);
    rightWheel.write(98);
  }
  }
}

Transmitter

#include <VirtualWire.h>


char val = 0;   // for incoming serial data

void setup()
{
   Serial.begin(9600);	  // Debugging only
    Serial.println("setup");

    // Initialise the IO and ISR
   vw_set_tx_pin(22); 
    vw_setup(2000);	 // Bits per sec
    
}
void loop() {


  if (Serial.available() > 0) {
val = Serial.read();
if(val = 'f');
char *msg = "f";
  vw_send((uint8_t *)msg, strlen(msg));
  vw_wait_tx();
  delay(5);
  
}
}

Thanks, SO much.

In both the transmitter and the receiver code, you only have one '=' operator in your IF statement condition when it should be '=='.

if( buf[0] == 'f' )

Hazard, Do you know if the chip is hard to install? I need something non-complex because I am basically done with 0 time left but I have to deal with the errors of the two libraries I want to use not being able to work together.

The chip is easy to install if you have a breadboard or if you can make your own pcb board. It will run off the same power supply as the servos, and it only needs one pin from the Arduino, Serial TX or Software Serial TX. It uses either 4800 or 19200 as a baud rate, 19200 is obviously faster communication.

I made a note to myself. :slight_smile:

//If baud pin is tied to Vdd or left open, set baud rate to 19200
//otherwise baud pin is tied to Vss and baud rate is 4800

Make sure grounds are connected.

For my robot I use a BOE shield that has spots for servos. I use it because it has those, could I put this chip there? Also, do you know of any places who sell it like nationally?

It has a built in breadboard but I am running out of spots because I have so many devices on it.

Alphacap22:
For my robot I use a BOE shield that has spots for servos. I use it because it has those, could I put this chip there? Also, do you know of any places who sell it like nationally?

I don't know if it can be used with that shield. It might work, but I really dont know. I bought my chip from eBay, and they tend to ship practically everywhere.

Alright I will look buy it now. Also, do you know of any other libraries to send data instead of the Virtualwire for Rf? Or is that the best one? If i could find a replacement it would be perfect.

To my knowledge, its the best one/ only one. That is if someone is currently making a better one.

Attached is my library.

SerialServo.zip (2.83 KB)

Can I send you a personal message on the forum if I have any issues ?

Sure I guess. Actually, I would rather we keep it on the post. This way if anyone else is having the same issues, they will know how you solved them. Plus it will allow others to joint in.

Do you know where I can get a circuit diagram for it? I cannot find it.

PDF link in HERE