I have copied a couple of example sketches using Timer.h, but get the same result with them all. Her's my very simple code:
#include "Timer.h"
Timer t;
int secCtr;
void setup()
{
Serial.begin(9600);
t.every(1000,updateCount); //update counter every second
}
void loop()
{
t.update();
}
void updateCount()
{
secCtr = secCtr + 1;
Serial.println(secCtr);
}
I copied this from an example on Arduino website and only modified the name of the called function and what happens within the called function, so I can't figure out why it doesn't work.
The error I get is as follows:
Arduino: 1.8.5 (Windows 10), Board: "Arduino/Genuino Uno"
D:_Arduino\Misc\Timer__test_2\Timer__test_2.ino: In function 'void setup()':
Timer__test_2:10: error: no matching function for call to 'Timer::every(int, void (&)())'
t.every(1000,updateCount); //update counter every second
^
D:_Arduino\Misc\Timer__test_2\Timer__test_2.ino:10:26: note: candidates are:
In file included from D:_Arduino\Misc\Timer__test_2\Timer__test_2.ino:1:0:
D:\Documents\Arduino\libraries\Timer-2.1/Timer.h:40:10: note: int8_t Timer::every(long unsigned int, void ()(void), void*)
int8_t every(unsigned long period, void (callback)(void), void* context);
^
D:\Documents\Arduino\libraries\Timer-2.1/Timer.h:40:10: note: candidate expects 3 arguments, 2 provided
D:\Documents\Arduino\libraries\Timer-2.1/Timer.h:41:10: note: int8_t Timer::every(long unsigned int, void ()(void), int, void*)
int8_t every(unsigned long period, void (callback)(void), int repeatCount, void* context);
^
D:\Documents\Arduino\libraries\Timer-2.1/Timer.h:41:10: note: candidate expects 4 arguments, 2 provided
exit status 1
no matching function for call to 'Timer::every(int, void (&)())'