Pages: [1]   Go Down
Author Topic: .cpp and .h files  (Read 449 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 75
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Netherlands
Offline Offline
Jr. Member
**
Karma: 0
Posts: 83
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1]   Go Up
Jump to: