TimerOne Leonardo and Teensy 3.1 library location issues

Status
Not open for further replies.

RichardFerraro

Well-known member
I am simultaneously developing for Leonardo (forced into this by hardware) and Teensy 3.1 (love it).

The TimerOne library is located in c:\arduino\hardware\teensy\avr\libraries\TimerOne\

I have to move this library to
c:\arduino\libraries\TimerOne
for the Leonardo code to find it; however,
this location causes TeensyDuino to not compile for the Teensy 3.1.

If I keep TimerOne library in c:\arduino\hardware\teensy\avr\libraries\TimerOne\
and point to it specifically in the Leonardo code
#include <c:\arduino\hardware\teensy\avr\libraries\TimerOne\TimerOne.h>

I get undefined references (e.g., TimerOne::clockSelectBits)

How should I handle this so that both the Leonardo code and the Teensy code both compile?

thanks

Richard
 
I don't know if this is a smart thing to do, but...
I simply copied TimerOne folder to
c:\arduino\libraries\
such that it also resides in c:\arduino\hardware\teensy\avr\libraries.

Both Leonardo and Teensy 3.1 targets compiled.
 
First, quit Arduino while copying stuff around. Arduino only rescans libraries at startup, so you must restart it after you've made any change.

Do not put the full pathname in a #include. That's just asking for trouble.

The proper way to customize involves copying the entire library to Documents/Arduino/libraries. Of course, that assumes your sketchbook location is set to Documents (the default). If you've changed the sketchbook location in File > Preferences, put the copy into the libraries folder of wherever Arduino is configured to look for your sketchbook folder.

When compiling for Teensy, assuming the original is still in place, you should see a message telling you there's 2 copies, and which copy it is and isn't actually using. That message is normal and proper to see when you have 2 copies that could either be used.
 
Status
Not open for further replies.
Back
Top