Have any of you recent experiences with those two, are they still in stable operation, have tried different examples of Chrono e.g., but it does not work... For instance, the simple example like the one below does not compile
// INCLUDE CHRONO LIBRARY
// Download : https://github.com/SofaPirate/Chrono/archive/master.zip
#include <Chrono.h>
// Instanciate a Chrono object.
Chrono myChrono;
void setup() {
// Start the chronometer on setup.
myChrono.start();
}
void loop() {
// Check whether the chronometer has reached 1000 time units.
if (myChrono.hasPassed(1000)) {
// Do something here...
// Restart the chronometer.
myChrono.restart();
}
}
Error:
sketch_may15b:10: error: 'class Chrono' has no member named 'start'
myChrono.start();
^
Multiple libraries were found for "Chrono.h"
Used: /Users/imac27/Documents/Arduino/libraries/Chrono
Not used: /Users/imac27/Documents/Arduino/libraries/Chrono-master
exit status 1
'class Chrono' has no member named 'start'
I use FlexiTimer2 Library - simple to set up, uses an interrupt callback, where I increment a counter. You can set the interrupt to be called every second or whatever you want.
Sorry for my late reply, but I do not have computer on me
I have removed the master Chrono version... I guess it should work now, however, I have in the mean time implemented what I need with the millis()... so far so good, the problem is that if the program is running for few days it starts behaving strange... eventually it stops working. I guess the problem is with millis(), because after few days it becomes unstable...
Is there a way to reset millis() and start counting again, rather than counting all the time?
This could be a solution?
Hence I have started to use the Chrono... if necessary I will get back to it and eventually use the library
Is there a way to reset millis() and start counting again, rather than counting all the time?
No unless you want to reset the Arduino.
However, why would you need to do it anyway ? When you want to start timing save the current value of millis(). Then, when you want to know how much time has passed compare the start time with the current value of millis().
biggles:
I use FlexiTimer2 Library - simple to set up, uses an interrupt callback, where I increment a counter. You can set the interrupt to be called every second or whatever you want.
thanks for the input, will have it a go at some time!