Problem with servo and virtualwire libraries

Hi !
I need to use both "servo" and "virtualwire" libraries on the same arduino uno board.
I tried but it failed. There was the message "error vector 11" in the error box.
I searched on the net and it seems to be a timer problem (both libraries are using the same timer) and the only solutions I found was to use other libraries to control the servomotors (servotimer2 was often quoted)
But I don't know how to use those libraries and I can't find proper example.
Can someone please explain me this library or an other solution if it exist ?

But I don’t know how to use those libraries

Exactly the same as the regular Servo library.

I tried my former code with #include
I just replace “Servo myservo1” by :

ServoTimer2 myservo1;  // create servo object to control a servo
ServoTimer2 myservo2;  // create servo object to control a servo

sketch_apr27b:11: error: ‘ServoTimer2’ does not name a type
sketch_apr27b:12: error: ‘ServoTimer2’ does not name a type

It should be #include <ServoTimer2.h>

Also AFAIK you use servo.write(vvv) but the value vvv must be millisecs, not degrees.

…R

I wrote ServoTimer2.h on my code.
Alright thank you for the help.
But I still have a problem to declare my servo.

But I still have a problem to declare my servo.

So, post your real code, and your error message(s).

You did download the ServoTimer2 library, didn't you?

Hello i have the same problem of compatibility and i may be stupid but i don't find where can i download ServoTimer2, can you help me ? :slight_smile:

acharr:
Hello i have the same problem of compatibility and i may be stupid but i don't find where can i download ServoTimer2, can you help me ? :slight_smile:

You want I should google that for you? Well, OK.

https://www.google.com/search?q=servotimer2+download&ie=utf-8&oe=utf-8

I got my copy here

...R

Here is my code.
I corrected the mistakes but it still not compile :confused:

test_servotimer2_ino.ino (1.47 KB)

I downloaded the ServoTimer2 library from Robin2's link, unzipped it in the proper place, and copied your code into the IDE (started after installing the library). I got an "error", too:

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

I have no idea how you would "fix" this.

I had to download the library again (the earlier copy got lost somewhere). I unzipped the download and copied the directory into the libraries directory of the Arduino IDE and your code in Reply #9 compiled without any problem.

...R