a few years ago i came across a timer library called Elapsed. im working on a project now that could use this library but when i added it to the libraries of the new arduino 1.0.5 and try the examples it doesnt compile and i get this message-
/Applications/Arduino-1.app/Contents/Resources/Java/libraries/Elapsed/Elapsed.cpp: In member function 'void Elapsed::reset()':
/Applications/Arduino-1.app/Contents/Resources/Java/libraries/Elapsed/Elapsed.cpp:52: error: 'micros' was not declared in this scope
/Applications/Arduino-1.app/Contents/Resources/Java/libraries/Elapsed/Elapsed.cpp:53: error: 'millis' was not declared in this scope
/Applications/Arduino-1.app/Contents/Resources/Java/libraries/Elapsed/Elapsed.cpp: In member function 'long unsigned int Elapsed::intervalMs()':
/Applications/Arduino-1.app/Contents/Resources/Java/libraries/Elapsed/Elapsed.cpp:59: error: 'millis' was not declared in this scope
/Applications/Arduino-1.app/Contents/Resources/Java/libraries/Elapsed/Elapsed.cpp: In member function 'long unsigned int Elapsed::intervalUs()':
/Applications/Arduino-1.app/Contents/Resources/Java/libraries/Elapsed/Elapsed.cpp:65: error: 'micros' was not declared in this scope
Might be where you have the library stored. All extra libraries should be in the same location as the main libraries, typically C:\Program Files\Arduino\libraries(put folder here)
I'm on a mac and have all my libraries in the same spot and they all work, except this one. i imagine its in the right spot if it comes up on my list of examples.
It's also been included the same way other libraries have been included and still doesnt work. here is a copy of the example code.
#include <Elapsed.h>
void setup()
{
Serial.begin (115200);
} // end of setup
static Elapsed time;
void loop() {
// if time is up, print "tick" and reset timer
if (time.intervalMs () > 500)
{
Serial.println ("tick");
time.reset ();
}
} // end of loop