HomeWaterLeaksDetection
|
#include "Wire.h"
#include "DS3231.h"
#include "Arduino.h"
#include "Setup.h"
#include <map>
#include <HTMLDataSource.h>
Go to the source code of this file.
Classes | |
class | DateTime |
Macros | |
#define | DELTA_TIME(time1, time2) ((time_t)((time1) - (time2))) |
Calculates the time difference between two times given as parameters. More... | |
#define | MILLIS_PER_SEC 1000UL |
number of milliseconds in onc second More... | |
#define | SECS_PER_MIN 60UL |
number of seconds in one minute More... | |
#define | MINS_PER_HOUR 60UL |
number of minutes in one hour More... | |
#define | HOURS_PER_DAY 24UL |
numer of hours in one day More... | |
#define | MILLIS_PER_MIN (MILLIS_PER_SEC * SECS_PER_MIN) |
number of milliseconds in one minute More... | |
#define | MILLIS_PER_HOD (MILLIS_PER_MIN * MINS_PER_HOUR) |
number of milliseconds in one hour More... | |
#define | MILLIS_PER_DAY (MILLIS_PER_HOD * HOURS_PER_DAY) |
number of milliseconds in one day More... | |
#define | SEC_TO_MILLIS(s) ((time_t)(s) * MILLIS_PER_SEC) |
Converts seconds given as a parameter to milliseconds. More... | |
#define | MIN_TO_MILLIS(m) ((time_t)(m) * MILLIS_PER_MIN) |
Converts minutes given as a parameter to milliseconds. More... | |
#define | HOD_TO_MILLIS(h) ((time_t)(h) * MILLIS_PER_HOD) |
Converts hours given as a parameter to milliseconds. More... | |
#define | DAY_TO_MILLIS(d) ((time_t)(d) * MILLIS_PER_DAY) |
Converts days given as a parameter to milliseconds. More... | |
#define | MILLIS(time) ((time) % MILLIS_PER_SEC) |
Calculates the number of milliseconds when formatting the time given in milliseconds. More... | |
#define | SECS(time) (((time) / MILLIS_PER_SEC) % SECS_PER_MIN) |
Calculates the number of seconds when formatting the time given in milliseconds. More... | |
#define | MINS(time) (((time) / MILLIS_PER_MIN) % MINS_PER_HOUR) |
Calculates the number of minutes when formatting the time given in milliseconds. More... | |
#define | HOURS(time) (((time) / MILLIS_PER_HOD) % HOURS_PER_DAY) |
Calculates the number of hours when formatting the time given in milliseconds. More... | |
#define | DAYS(time) ((time) / MILLIS_PER_DAY) |
Calculates the number of days when formatting the time given in milliseconds. More... | |
#define | FORMAT_2_DIGITS(x) ((x) >= 10 ? String(x) : ("0" + String(x))) |
Converts the number given as a parameter into a 2 digit string. More... | |
#define | FORMAT_3_DIGITS(x) |
Converts the number given as a parameter into a 3 digit string. More... | |
#define | FORMAT_TIME(time) |
Converts a time in milliseconds into a formatted string. More... | |
Typedefs | |
typedef unsigned long | time_t |
Referring to the data type unsigned long as time_t. More... | |
#define DAY_TO_MILLIS | ( | d | ) | ((time_t)(d) * MILLIS_PER_DAY) |
Converts days given as a parameter to milliseconds.
d | number of days |
Definition at line 77 of file DateTime.h.
#define DAYS | ( | time | ) | ((time) / MILLIS_PER_DAY) |
Calculates the number of days when formatting the time given in milliseconds.
time | in milliseconds |
Definition at line 114 of file DateTime.h.
#define DELTA_TIME | ( | time1, | |
time2 | |||
) | ((time_t)((time1) - (time2))) |
Calculates the time difference between two times given as parameters.
Since the data type of both parameters is unsigned long, it is not necessary to check if the result of the operation is negative or not. It is taken care of all automatically by the data type itself. Both parameters are in milliseconds.
time1 | time x |
time2 | time y |
Definition at line 36 of file DateTime.h.
#define FORMAT_2_DIGITS | ( | x | ) | ((x) >= 10 ? String(x) : ("0" + String(x))) |
Converts the number given as a parameter into a 2 digit string.
For example, number 9 becomes "09".
x | number that is going to be formatted |
Definition at line 123 of file DateTime.h.
#define FORMAT_3_DIGITS | ( | x | ) |
Converts the number given as a parameter into a 3 digit string.
For example, number 9 becomes "009" or number 15 becomes "015".
x | number that is going to be formatted |
Definition at line 134 of file DateTime.h.
#define FORMAT_TIME | ( | time | ) |
Converts a time in milliseconds into a formatted string.
The format of the final string is [days:hrs:mins:secs:millis].
time | in millisecond that is going to be formatted |
Definition at line 142 of file DateTime.h.
#define HOD_TO_MILLIS | ( | h | ) | ((time_t)(h) * MILLIS_PER_HOD) |
Converts hours given as a parameter to milliseconds.
h | number of hours |
Definition at line 72 of file DateTime.h.
#define HOURS | ( | time | ) | (((time) / MILLIS_PER_HOD) % HOURS_PER_DAY) |
Calculates the number of hours when formatting the time given in milliseconds.
time | in milliseconds |
Definition at line 107 of file DateTime.h.
#define HOURS_PER_DAY 24UL |
numer of hours in one day
Definition at line 48 of file DateTime.h.
#define MILLIS | ( | time | ) | ((time) % MILLIS_PER_SEC) |
Calculates the number of milliseconds when formatting the time given in milliseconds.
time | in milliseconds |
Definition at line 86 of file DateTime.h.
#define MILLIS_PER_DAY (MILLIS_PER_HOD * HOURS_PER_DAY) |
number of milliseconds in one day
Definition at line 55 of file DateTime.h.
#define MILLIS_PER_HOD (MILLIS_PER_MIN * MINS_PER_HOUR) |
number of milliseconds in one hour
Definition at line 53 of file DateTime.h.
#define MILLIS_PER_MIN (MILLIS_PER_SEC * SECS_PER_MIN) |
number of milliseconds in one minute
Definition at line 51 of file DateTime.h.
#define MILLIS_PER_SEC 1000UL |
number of milliseconds in onc second
Definition at line 42 of file DateTime.h.
#define MIN_TO_MILLIS | ( | m | ) | ((time_t)(m) * MILLIS_PER_MIN) |
Converts minutes given as a parameter to milliseconds.
m | number of minutes |
Definition at line 67 of file DateTime.h.
#define MINS | ( | time | ) | (((time) / MILLIS_PER_MIN) % MINS_PER_HOUR) |
Calculates the number of minutes when formatting the time given in milliseconds.
time | in milliseconds |
Definition at line 100 of file DateTime.h.
#define MINS_PER_HOUR 60UL |
number of minutes in one hour
Definition at line 46 of file DateTime.h.
#define SEC_TO_MILLIS | ( | s | ) | ((time_t)(s) * MILLIS_PER_SEC) |
Converts seconds given as a parameter to milliseconds.
s | number of seconds |
Definition at line 62 of file DateTime.h.
#define SECS | ( | time | ) | (((time) / MILLIS_PER_SEC) % SECS_PER_MIN) |
Calculates the number of seconds when formatting the time given in milliseconds.
time | in milliseconds |
Definition at line 93 of file DateTime.h.
#define SECS_PER_MIN 60UL |
number of seconds in one minute
Definition at line 44 of file DateTime.h.
typedef unsigned long time_t |
Referring to the data type unsigned long as time_t.
It is used for variables holding time information in milliseconds.
Definition at line 20 of file DateTime.h.