0
votes

I've created a Quadcopter based on an Arduino Leonardo, and im using the Servo.h library to control the motor output. I'm now installing a cheap RF Link kit as the communication for the first wireless test flight, and i've downloaded VirtualWire library. It works flawlessly, but it uses the same timer as servo library.

All the libraries i've found uses timer1, and it seems way over my capabilities to change the source code to use another timer. Im also not sure that timer2 has a high enough resolution to handle the communication (timer1 is 16bit, timer2 is 8bit).

Have anyone encountered this problem before? Anyone with some good suggestions to how i can get around this problem?

All suggestions and tips are appreciated!

1

1 Answers

0
votes

I swapped the receiver to a Arduino UNO, and used the ServoTimer2 library http://forum.arduino.cc/index.php?topic=21975.0

Its not working straight out of the box, so you have to change

extern "C" {
   // AVR LibC Includes
   #include <inttypes.h
   #include <avr/interrupt.h>
   #include <WConstants.h>
}

to

#include<Arduino.h>

This is not a perfect solution, but it works for now.