I'm trying to operate a few servos simultaneously without using the delay() function. I want to use a timer library to rotate a servo back to its starting positions after a set delay. However I want to operate other servos during that delay.
I've experimented with a couple of timer libraries posted here. However as far as I understand the timer libraries and the servo library use the same hardware timers on the Due. Consequently, the Arduino IDE would not let me compile while using both libraries.
What are some possible workaround for this? I need to operate 11 servos total, maybe 3 of them simultaneously.
Hi,
I have the same problem as motomoto. When I include both DueTimer.h and Servo.h, I get:
sam\Servo.cpp.o: In function `TC0_Handler':
C:\Program Files (x86)\Arduino-1.0.5\Arduino\libraries\Servo\arch\sam/Servo.cpp:75: multiple definition of `TC0_Handler'
DueTimer_master\DueTimer.cpp.o:C:\Users\sydian\Documents\Arduino\libraries\DueTimer_master/DueTimer.cpp:231: first defined here
sam\Servo.cpp.o: In function `TC2_Handler':
C:\Program Files (x86)\Arduino-1.0.5\Arduino\libraries\Servo\arch\sam/Servo.cpp:70: multiple definition of `TC2_Handler'
DueTimer_master\DueTimer.cpp.o:C:\Users\sydian\Documents\Arduino\libraries\DueTimer_master/DueTimer.cpp:239: first defined here
sam\Servo.cpp.o: In function `TC5_Handler':
C:\Program Files (x86)\Arduino-1.0.5\Arduino\libraries\Servo\arch\sam/Servo.cpp:65: multiple definition of `TC5_Handler'
DueTimer_master\DueTimer.cpp.o:C:\Users\sydian\Documents\Arduino\libraries\DueTimer_master/DueTimer.cpp:251: first defined here
sam\Servo.cpp.o: In function `TC4_Handler':
C:\Program Files (x86)\Arduino-1.0.5\Arduino\libraries\Servo\arch\sam/Servo.cpp:60: multiple definition of `TC4_Handler'
DueTimer_master\DueTimer.cpp.o:C:\Users\sydian\Documents\Arduino\libraries\DueTimer_master/DueTimer.cpp:247: first defined here
sam\Servo.cpp.o: In function `TC3_Handler':
C:\Program Files (x86)\Arduino-1.0.5\Arduino\libraries\Servo\arch\sam/Servo.cpp:55: multiple definition of `TC3_Handler'
DueTimer_master\DueTimer.cpp.o:C:\Users\sydian\Documents\Arduino\libraries\DueTimer_master/DueTimer.cpp:243: first defined here
collect2: ld returned 1 exit status
Because there are some people with this problem, I made a modification on DueTimer that will allow you to put to work both Servo and DueTimer together.
I didn't have time to test, but I'm pretty sure everything will work just fine.