I am testing JChristensen/Timer libraryhttps://github.com/JChristensen/Timer/tree/v2.1
Something is not right with it that I can not use this example
#include "Timer.h"
Timer t;
int ledEvent;void setup()
{
Serial.begin(9600);
int tickEvent = t.every(2000, doSomething, (void*)0);
Serial.print("2 second tick started id=");
Serial.println(tickEvent);pinMode(13, OUTPUT);
ledEvent = t.oscillate(13, 50, HIGH);
Serial.print("LED event started id=");
Serial.println(ledEvent);int afterEvent = t.after(10000, doAfter, (void*)0);
Serial.print("After event started id=");
Serial.println(afterEvent);
}void loop()
{
t.update();
}void doSomething(void *context)
{
Serial.print("2 second tick: millis()=");
Serial.println(millis());
}void doAfter(void *context)
{
Serial.println("stop the led event");
t.stop(ledEvent);
t.oscillate(13, 500, HIGH, 5);
}
The error I get is this
sketch_may08b.ino: In function 'void setup()':
sketch_may08b:9: error: invalid conversion from 'void (*)(void*)' to 'void (*)()'
sketch_may08b:9: error: initializing argument 2 of 'int8_t Timer::every(long unsigned int, void (*)(), int)'
sketch_may08b:9: error: invalid conversion from 'void*' to 'int'
sketch_may08b:9: error: initializing argument 3 of 'int8_t Timer::every(long unsigned int, void (*)(), int)'
sketch_may08b:18: error: no matching function for call to 'Timer::after(int, void (&)(void*), void*)'
/Volumes/OPTI/Arduino/libraries/Timermaster/Timer.h:42: note: candidates are: int8_t Timer::after(long unsigned int, void (*)())
I really need to see how this works.