Pages: [1]   Go Down
Author Topic: Importing a library within a library.  (Read 281 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

I have written a simple library (my first) to work with a set of LED matrices. The library utilizes TimerOne, and I'm having some problems importing the TimerOne library within mine...

Here is a snippet from my libary:
Code:
#include "LEDMatrix.h"
#include <TimerOne.h>

LEDMatrix_Class LEDMatrix;

void LEDMatrix_Class::init(unsigned int latchPin, unsigned int clockPin, unsigned int dataPin) {
 
  _latchPin = latchPin;
  _clockPin = clockPin;
  _dataPin = dataPin;
 
  pinMode(_dataPin, OUTPUT);
  pinMode(_clockPin, OUTPUT);
  pinMode(_latchPin, OUTPUT);
 
  Timer1.initialize(LED_TIMER_PERIOD);
  Timer1.attachInterrupt(drawBufferContents);
}

The error I'm getting is: TimerOne.h: No such file or directory. I know that the TimerOne library is in the right spot because the code worked before I decided to make a library out of it. Can't seem to figure out where I'm going wrong. Any help would be much appreciated!
Logged

Bergamo
Offline Offline
God Member
*****
Karma: 1
Posts: 663
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Nick,

I had the same problem... you have to use relative (or absolute) paths to .h file and include the library also in your sketch:
http://arduino.cc/forum/index.php/topic,70311.0.html

bye
Logged

lucadentella.it

Pages: [1]   Go Up
Jump to: