View Full Version : Problems compiling when using Servo.h, Teensy 3.0/beta7 Mac

11-12-2012, 06:46 AM
I'm using the Arduino 1.0.2 Beta 7 Teensy build on my Mac, 10.6.8, and was attempting to use a servo in one of my sketches. It was unable to compile due to various references to registers it claims are undefined. So just to make sure it wasn't my code, I made a new sketch that does nothing but include Servo.h, and get the same errors.

Here's a screenshot of my Arduino with the settings displayed (to verify I have the right IDE/board settings):


I've searched around for a while but can't seem to find anyone else with this issue. I also tried beta6 as well to no avail.

11-12-2012, 04:33 PM
Here's my first attempt to port Servo.


To use this, control-click on Arduino and choose "show package contents", then find Servo within and replace Servo.cpp and Servo.h with these files.

Please let me know how it works for you?

11-12-2012, 05:52 PM
Now I'm getting this error on compile.

pins_teensy.c.o: In function `pdb_isr':
/Applications/Development/Teensy Arduino.app/Contents/Resources/Java/hardware/teensy/cores/teensy3/pins_teensy.c:242: multiple definition of `pdb_isr'
Servo/Servo.cpp.o:/Applications/Development/Teensy Arduino.app/Contents/Resources/Java/libraries/Servo/Servo.cpp:463: first defined here
collect2: ld returned 1 exit status

11-12-2012, 07:57 PM
Opps. Yeah, I deleted that from pins_teensy.c (in the version that will soon become "beta8"). If you edit that file and just delete the entire pdb_isr() function, does it then work?

11-12-2012, 08:09 PM
Yep it does! I was able to do a full 180 degree sweep with my servo. Thanks!