Go Down

Topic: .cpp and .h files (Read 487 times) previous topic - next topic

imsmooth

In the timer1 example under community codes I see that the main routine has
#include "TimerOne.h"

where does the Timer1.cpp go which has all of the coding? How does that get included into my sketch?

qistoph

Hi imsmooth,

As it says on the Timer1 page ()
"To install, simply unzip and put the files in Arduino/hardware/libraries/Timer1/ "

So, that's where the TimerOne.cpp and TimerOne.h will go.

Then in your sketch, you'll just have to write
#include "TimerOne.h"
or little bit neater
#include <TimerOne.h>

The compiler is told by the Arduino IDE where to find libraries. Any libraries that you use, by #including them, will be included in you compiled sketch.

Go Up