WindRose 1.0
Custom Hardware , Firmware and Software for Robotic Cellular Automata Experiments
Circadian.h
Go to the documentation of this file.
1
10#ifndef Circadian_h
11#define Circadian_h
12
13#include "arduino.h"
14
19class Circadian {
20private:
24 unsigned long previousMillis;
25
29 unsigned long interval;
30
31public:
36 Circadian(unsigned long _interval);
37
42 bool isElapsed();
43
49 static unsigned long secondsToMillis(unsigned int seconds);
50
56 static unsigned long minutesToMillis(unsigned int minutes);
57
63 static unsigned long hoursToMillis(unsigned int hours);
64
70 static unsigned long hertzToMillis(float hertz);
71};
72
73#endif // Circadian_h
A class to handle periodic time intervals.
Definition: Circadian.h:19
static unsigned long hoursToMillis(unsigned int hours)
Converts hours to milliseconds.
Definition: Circadian.cpp:61
static unsigned long minutesToMillis(unsigned int minutes)
Converts minutes to milliseconds.
Definition: Circadian.cpp:52
bool isElapsed()
Checks if the interval has elapsed.
Definition: Circadian.cpp:24
static unsigned long hertzToMillis(float hertz)
Converts frequency in hertz to milliseconds (period of the frequency).
Definition: Circadian.cpp:70
static unsigned long secondsToMillis(unsigned int seconds)
Converts seconds to milliseconds.
Definition: Circadian.cpp:43
Circadian(unsigned long _interval)
Constructor to initialize the interval and record the current time.
Definition: Circadian.cpp:15