The only difference is that you'll declare your Servo object as ServoTimer2 instead of Servo or SoftwareServo. Follow the next steps to install that library in the. So you should be able to keep most of your code. The RadioHead library provides an easy way to work with the 433 MHz transmitter/receiver with the Arduino. Library except that pulse widths are in microseconds not degrees. The usage and method naming is similar to the Arduino software servo The commands you use with ServoTimer2 library are supposed to be identical or similar to the commands used with the Servo library with one difference: This means you will need to download ServoTimer2 library, as it isn't a part of the standard Arduino distribution, put the ServoTimer2.h and ServoTimer2.cpp into ServoTimer2 directory in your Arduino libraries directory (for me the Arduino directory is /usr/share/arduino so, I put the servotimer2 files into /usr/share/arduino/libraries/ServoTimer2/), and then replace #include "Servo.h" The ServoTimer2 library is meant to be a replacement for the servo library. You could try rewriting one of the two libraries to use 8-bit timers, but you may lose features and functionality. The problem is that VirtualWire library also wants to use the only 16-bit timer available. In VirtualWire.cpp lin 568, as mentioned in the error you saw: // Assume Arduino Uno (328p or similar)Īrduino Uno has only a single 16-bit timer, and Servo.cpp library seems to want it. Handle_interrupts(_timer1, &TCNT1, &OCR1A) In the Servo.cpp source (line 103 as mentioned in the error you saw): #if defined(_useTimer1) The problem is that both Servo.cpp and VirtualWire.cpp try to use the same interrupt vector.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |