-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDigitClock.hpp
45 lines (40 loc) · 897 Bytes
/
DigitClock.hpp
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
#ifndef _DIGITCLOCK_HPP
#define _DIGITCLOCK_HPP
#include <Arduino.h>
class DigitClock
{
private:
int dataPin;
int clockPin;
int latchPin;
int hours;
int minutes;
int seconds;
byte values[11]=
{
0b01111011, // 0
0b01100000, // 1
0b01011101, // 2
0b01110101, // 3
0b01100110, // 4
0b00110111, // 5
0b00111111, // 6
0b01100001, // 7
0b01111111, // 8
0b01110111, // 9
0b10000000 //dp
};
public:
DigitClock(int dataPin, int clockPin, int latchPin);
void testDigit();
void renderTimeDigit(int hours, int minutes, int seconds, bool dots=false);
int getHours();
int getMinutes();
int getSeconds();
void setHours(int hours);
void setMinutes(int minutes);
void setSeconds(int seconds);
void setTime(int hours, int minutes, int seconds);
void renderDots();
};
#endif