Closed hank880907 closed 4 years ago
Hi @hank880907
You included Servo.h
but didn't use any feature of Servo Library.
Just comment the line to
//#include <Servo.h>
to eliminate compiler error
It's very tricky, without any conflict, to use both low-level libraries dealing with Interrupts.
Just use either Servo or TimerInterrupt library.
Hi thanks for replying I needed to use the servo library in my project (just haven't written any code for it yet) So are there a way to use the Servo library and timer interrupt library at the same time?
Currently no way unless one of the library has to be rewritten or a combined library is created. I'm not ready to spend time to do the combination as I did for ESP32 and ESP8266 as they are much more powerful and popular.
For example
I suggest that you use either ESP8266 or ESP32 to replace the old Mega.
My board was an Arduino Mega. I cannot include the servo library if I include the TimerInterrupt. I am using timer 5 which should be ok to use.
the error message is here:
libraries/Servo/avr/Servo.cpp.o (symbol from plugin): In function
ServoCount': (.text+0x0): multiple definition of
__vector_42' sketch/sketch_aug05b.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here collect2: error: ld returned 1 exit status exit status 1 Error compiling for board Arduino Mega or Mega 25my source code: