-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwimatrix.ino
58 lines (48 loc) · 976 Bytes
/
wimatrix.ino
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
55
56
57
58
#include "ledcontroller.h"
#include "wifi.h"
#include "netman.h"
#include "storage.h"
void setup() {
Serial.begin(115200);
delay(10);
Serial.println("Initializing Storage");
InitStorage();
// Uncomment to configure
// SaveWifiSSID("----");
// SaveWifiPassword("----");
// SaveHostname("WIMATRIX2");
// SaveMQTTHost("192.168.0.100");
// SaveMQTTUser("mqtt_user");
// SaveMQTTPass("---");
// SaveOTAPassword("---");
SetupLeds();
delay(1000);
SetMode(BACKGROUND_STRING_DISPLAY);
LedPrint("Boot", CRGB::Green);
delay(400);
SetupWiFi();
delay(400);
SetupMQTT();
delay(500);
LedPrint("Ready", CRGB::Green);
delay(1000);
SetBrightness(0.01);
delay(1000);
SetMode(MODE_CLOCK);
}
int schedCount = 0;
void loop() {
ArduinoOTA.handle();
if (!InOTA()) {
WiFiLoop();
MQTTLoop();
if (schedCount % 4) {
LedLoop();
yield();
}
}
schedCount++;
if (schedCount == 10) {
schedCount = 0;
}
}