-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClock.h
More file actions
42 lines (33 loc) · 1.09 KB
/
Copy pathClock.h
File metadata and controls
42 lines (33 loc) · 1.09 KB
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
#pragma once
class Clock
{
public:
void DrawBackground();
void DrawDate();
void DrawTime();
void CheckUpdate();
const char* GetMonthName(byte Month);
const char* GetDayName(byte Day);
char* GetNumStr(byte Num, char* Buffer, bool noLeadingZero);
void getTimeDigits(int* digits);
private:
void BigDigit(int x, int y, int digit1, int step);
void updateTime();
void updateDate();
int BigDigitY();
int currentDigits[4];
int currentMinute = -1;
int currentDate = -1;
// digit layout
int hemiDigitYGap = 2;
int lowerYOffset = LargeDigits::HalfHeight + hemiDigitYGap;
int midY = 320-2.4*LargeDigits::HalfHeight;
int digitOriginX = 5;
int interDigitX = LargeDigits::Width + 10;
unsigned long checkTimeMS = 0;
const unsigned long checkTimeDuration = 20000L; // only check time every 20s, reduce glitches?, time jumps to 01:53?? reprogramming interupts I2C?
bool blinkOn = false;
unsigned long blinkTimeMS = 0;
const unsigned long blinkDuration = 1000L; // blink the cursor
};
extern Clock clock;