Commit e0eeaec72a07177150ff99f9cdd1ddeb4a28d733

Authored by Thomas R. Koll
1 parent b70f876936
Exists in master

Lower brightness and reconnect when wifi connection is lost

Showing 1 changed file with 4 additions and 3 deletions Side-by-side Diff

regal-uhr/regal-uhr.ino
... ... @@ -57,9 +57,8 @@
57 57  
58 58 void setup() {
59 59 Serial.begin(9600);
60   -
61 60 matrix.begin(0x70); // 0x70 is the I2C address of the display
62   - matrix.write(10000); // clearing the display
  61 + matrix.setBrightness(10);
63 62  
64 63 connectWifi();
65 64  
66 65  
... ... @@ -69,8 +68,10 @@
69 68 timeClient.begin();
70 69 }
71 70  
72   -
73 71 void loop() {
  72 + if (WiFi.status() != WL_CONNECTED) {
  73 + connectWifi();
  74 + }
74 75 timeClient.update();
75 76 writeTime();
76 77 }