1
1
#include < ESP32-HUB75-MatrixPanel-I2S-DMA.h>
2
-
3
2
#include " Clockface.h"
4
3
#include " WiFiConnect.h"
5
4
#include " DateTime.h"
6
5
7
-
8
6
#define EEPROM_SIZE 512
9
7
10
8
MatrixPanel_I2S_DMA *dma_display = nullptr ;
@@ -16,12 +14,7 @@ uint16_t myBLACK = dma_display->color565(0, 0, 0);
16
14
uint16_t myWHITE = dma_display->color565 (255 , 255 , 255 );
17
15
uint16_t myBLUE = dma_display->color565 (0 , 0 , 255 );
18
16
19
-
20
- const int touchThreshold = 40 ;
21
17
byte displayBright = 32 ;
22
- bool touch8detected = false ;
23
- bool touch9detected = false ;
24
- unsigned long touchLastMillis = 0 ;
25
18
26
19
void displaySetup () {
27
20
HUB75_I2S_CFG mxconfig (
@@ -41,22 +34,6 @@ void displaySetup() {
41
34
dma_display->fillScreen (myBLACK);
42
35
}
43
36
44
-
45
- void gotTouch8 (){
46
- touch8detected = (millis () - touchLastMillis > 1000 );
47
- }
48
-
49
- void gotTouch9 (){
50
- touch9detected = (millis () - touchLastMillis > 1000 );
51
- }
52
-
53
- void changeDisplayBright () {
54
- displayBright += 32 ;
55
- dma_display->setBrightness8 (displayBright);
56
- Serial.print (" Bright set to " );
57
- Serial.println (displayBright);
58
- }
59
-
60
37
void setup () {
61
38
62
39
Serial.begin (115200 );
@@ -78,22 +55,9 @@ void setup() {
78
55
dateTime.begin ();
79
56
80
57
clockface->setup (&dateTime);
81
-
82
- touchAttachInterrupt (T8, gotTouch8, touchThreshold);
83
- touchAttachInterrupt (T9, gotTouch9, touchThreshold);
84
58
}
85
59
86
60
void loop () {
87
61
clockface->update ();
88
62
89
- if (touch8detected) {
90
- touch8detected = false ;
91
- changeDisplayBright ();
92
- touchLastMillis = millis ();
93
- }
94
- if (touch9detected) {
95
- touch9detected = false ;
96
- clockface->externalEvent (0 );
97
- touchLastMillis = millis ();
98
- }
99
63
}
0 commit comments