@@ -39,7 +39,7 @@ See more at http://blog.squix.ch
39
39
* Begin Settings
40
40
**************************/
41
41
// WIFI
42
- const char * WIFI_SSID = " yourssid" ;
42
+ const char * WIFI_SSID = " yourssid" ;
43
43
const char * WIFI_PWD = " yourpassw0rd" ;
44
44
45
45
// Setup
@@ -65,6 +65,12 @@ String timeZoneIds [] = {"America/New_York", "Europe/London", "Europe/Paris", "A
65
65
WorldClockClient worldClockClient (" de" , " CH" , " E, dd. MMMMM yyyy" , 4 , timeZoneIds);
66
66
67
67
68
+ // declaring prototypes
69
+ bool drawFrame1 (SSD1306 *display, SSD1306UiState* state, int x, int y);
70
+ bool drawFrame2 (SSD1306 *display, SSD1306UiState* state, int x, int y);
71
+ bool drawFrame3 (SSD1306 *display, SSD1306UiState* state, int x, int y);
72
+ bool drawFrame4 (SSD1306 *display, SSD1306UiState* state, int x, int y);
73
+
68
74
// this array keeps function pointers to all frames
69
75
// frames are the single views that slide from right to left
70
76
bool (*frames[])(SSD1306 *display, SSD1306UiState* state, int x, int y) = { drawFrame1, drawFrame2, drawFrame3, drawFrame4};
@@ -93,7 +99,7 @@ void setup() {
93
99
display.setContrast (255 );
94
100
95
101
WiFi.begin (WIFI_SSID, WIFI_PWD);
96
-
102
+
97
103
int counter = 0 ;
98
104
while (WiFi.status () != WL_CONNECTED) {
99
105
delay (500 );
@@ -104,7 +110,7 @@ void setup() {
104
110
display.drawXbm (60 , 30 , 8 , 8 , counter % 3 == 1 ? ANIMATION_activeSymbole : ANIMATION_inactiveSymbole);
105
111
display.drawXbm (74 , 30 , 8 , 8 , counter % 3 == 2 ? ANIMATION_activeSymbole : ANIMATION_inactiveSymbole);
106
112
display.display ();
107
-
113
+
108
114
counter++;
109
115
}
110
116
@@ -178,7 +184,7 @@ void drawClock(SSD1306 *display, int x, int y, int timeZoneIndex, String city, c
178
184
display->setFont (ArialMT_Plain_10);
179
185
display->drawString (x + 60 , y + 5 , city);
180
186
display->setFont (Crushed_Plain_36);
181
- display->drawXbm (x, y, 60 , 60 , icon);
187
+ display->drawXbm (x, y, 60 , 60 , icon);
182
188
display->drawString (x + 60 , y + 15 , worldClockClient.getHours (timeZoneIndex) + " :" + worldClockClient.getMinutes (timeZoneIndex));
183
189
184
190
}
@@ -204,5 +210,3 @@ void setReadyForWeatherUpdate() {
204
210
Serial.println (" Setting readyForUpdate to true" );
205
211
readyForUpdate = true ;
206
212
}
207
-
208
-
0 commit comments