-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdigits.h
More file actions
39 lines (33 loc) · 823 Bytes
/
digits.h
File metadata and controls
39 lines (33 loc) · 823 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
#ifndef DIGITS_H
#define DIGITS_H
#include <cstdint>
#define SEGMENT_SIZE 3
#define DIGIT_SIZE (7 * SEGMENT_SIZE)
#define HOUR1 0
#define HOUR2 DIGIT_SIZE
#define DOT1 (HOUR2 + DIGIT_SIZE)
#define DOT2 (DOT1 + 1)
#define MINUTE1 (DOT2 + 1)
#define MINUTE2 MINUTE1 + DIGIT_SIZE
#define NUMPIXELS MINUTE2 + DIGIT_SIZE
/*
Display bit mask
3
4 2
1
5 7
6
*/
// Bit mapping
const uint8_t ZERO = 0b01111110;
const uint8_t ONE = 0b01000010;
const uint8_t TWO = 0b00110111;
const uint8_t THREE = 0b01100111;
const uint8_t FOUR = 0b01001011;
const uint8_t FIVE = 0b01101101;
const uint8_t SIX = 0b01111101;
const uint8_t SEVEN = 0b01000110;
const uint8_t EIGHT = 0b01111111;
const uint8_t NINE = 0b01101111;
const uint8_t digits[] = { ZERO, ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE };
#endif //DIGITS_H