-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRTClock.h
More file actions
41 lines (33 loc) · 704 Bytes
/
RTClock.h
File metadata and controls
41 lines (33 loc) · 704 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// RTClock.h
#ifndef _RTCLOCK_h
#define _RTCLOCK_h
#if defined(ARDUINO) && ARDUINO >= 100
#include "arduino.h"
#else
#include "WProgram.h"
#endif
// RTC Header Files
#include <Wire.h>
#include <ds3231.h>
// Define Time Structure Units
#define UNIT_NULL 0
#define UNIT_HOUR 1
#define UNIT_MINUTE 2
#define UNIT_SECOND 3
#define UNIT_MONTH 4
#define UNIT_DAY 5
#define UNIT_YEAR_SHORT 6
#define UNIT_YEAR 7
class RTClockClass
{
public:
RTClockClass();
~RTClockClass();
void resetClock();
void incrementUnit(uint8_t);
void decrementUnit(uint8_t);
uint8_t getUnit(uint8_t);
private:
struct ts t; // RTC time structure
};
#endif // _RTCLOCK_H