Go Down

Topic: Importing a library within a library. (Read 310 times) previous topic - next topic

nickrjensen

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: [Select]

#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!

lucadentella

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
lucadentella.it

Go Up