Hello All,
I've recently been looking through timer libraries and came to the conclusion that SimpleTimer might be the best option for my project. The issue with it is that I receive the following error whenever I try to run the provided testing code:
Timer_test.cpp.o: In function `setup':
C:\Program Files (x86)\Arduino/Timer_test.ino:14: undefined reference to `SimpleTimer::setInterval(long, void (*)())'
Timer_test.cpp.o: In function `loop':
C:\Program Files (x86)\Arduino/Timer_test.ino:18: undefined reference to `SimpleTimer::run()'
Timer_test.cpp.o: In function `__static_initialization_and_destruction_0':
C:\Program Files (x86)\Arduino/Timer_test.ino:4: undefined reference to `SimpleTimer::SimpleTimer()'
collect2.exe: error: ld returned 1 exit status
Error compiling.
The test code itself that Marcello provides is:
#include <SimpleTimer.h>
// the timer object
SimpleTimer timer;
// a function to be executed periodically
void repeatMe() {
Serial.print("Uptime (s): ");
Serial.println(millis() / 1000);
}
void setup() {
Serial.begin(9600);
timer.setInterval(1000, repeatMe);
}
void loop() {
timer.run();
}
Hopefully someone knows the solution to this problem, as I cannot seem to figure it out on my own.
Thanks in advanced,
~Lights