-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdisplay.h
More file actions
54 lines (47 loc) · 1.36 KB
/
Copy pathdisplay.h
File metadata and controls
54 lines (47 loc) · 1.36 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
43
44
45
46
47
48
49
50
51
52
53
54
#ifndef DISPLAY_H
#define DISPLAY_H
#include <Arduino.h>
#include <MD_Parola.h>
#include <MD_MAX72XX.h>
#include "config.h"
enum DisplayState {
SHOW_TZ_SCROLL,
SHOW_TZ_WAIT,
SHOW_TIME_LTR,
SHOW_TIME_RTL,
SHOW_TIME_STATIC
};
class DisplayManager {
public:
DisplayManager();
void begin(uint8_t intensity);
void setIntensity(uint8_t intensity);
void setFlip180(bool flip);
bool isFlipped180() { return flipped180; }
void update();
void setState(DisplayState newState);
DisplayState getState() { return state; }
void setCurrentTZ(int tz) { currentTZ = tz; }
int getCurrentTZ() { return currentTZ; }
void setTimeString(String timeStr);
void setTimezoneName(String tzName);
void setShowTimezone(bool show) { showTimezone = show; }
bool shouldShowTimezone() { return showTimezone; }
unsigned long getWaitStart() { return waitStart; }
void setTimeDisplayDuration(unsigned long duration) { timeDisplayDuration = duration; }
private:
void updateBlinkingColon();
String formatTimeWithBlinkingColon(String timeStr);
MD_Parola display;
DisplayState state;
int currentTZ;
char scrollBuffer[32];
unsigned long waitStart;
unsigned long lastBlinkTime;
bool colonVisible;
String currentTimeString;
bool showTimezone;
unsigned long timeDisplayDuration;
bool flipped180;
};
#endif