diff options
Diffstat (limited to 'datetimeHandler.cpp')
-rw-r--r-- | datetimeHandler.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/datetimeHandler.cpp b/datetimeHandler.cpp new file mode 100644 index 0000000..6e5abd5 --- /dev/null +++ b/datetimeHandler.cpp @@ -0,0 +1,19 @@ +#include "datetimeHandler.h" + +uint8_t localTemp = 255; +uint8_t localHum = 255; +uint8_t hour = 0; +uint8_t minute = 0; +uint8_t time_tab[6] = {'-', '-', ':', '-', '-', 0}; + +void setTime(String time) +{ + if(time.length() == 8) + { + hour = time.substring(0,2).toInt(); + time.substring(0,5).getBytes(time_tab, 5+1); + minute = time.substring(3,5).toInt(); + } +} + + |