forked from bracci/Qlockthree
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MyRTC.h
45 lines (32 loc) · 777 Bytes
/
MyRTC.h
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
42
43
44
45
/**
MyRTC
Klasse fuer den Zugriff auf die DS1307/DS3231 Echtzeituhr.
@mc Arduino/RBBB
@autor Christian Aschoff / caschoff _AT_ mac _DOT_ com
@version 2.1
@created 1.3.2011
*/
#ifndef MYRTC_H
#define MYRTC_H
#include "Arduino.h"
#include "TimeStamp.h"
class MyRTC : public TimeStamp {
public:
MyRTC(int address, byte statusLedPin);
void statusLed(boolean on);
void readTime();
void writeTime();
int8_t getTemperature();
void enableSQWOnDS1307();
void enableSQWOnDS3231();
void setSeconds(byte seconds);
byte getSeconds();
private:
int _address;
byte _statusLedPin;
byte _seconds;
byte decToBcd(byte val);
byte bcdToDec(byte val);
uint8_t conv2d(const char* p);
};
#endif