Skip to content

Commit 00a9265

Browse files
committed
Weather examples
1 parent 94386d0 commit 00a9265

File tree

122 files changed

+25280
-22301
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+25280
-22301
lines changed

examples/Inkplate10/Projects/Daily_Weather_Station_Example/Daily_Weather_Station_Example.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ void setup()
137137
// Welcome screen
138138
display.setCursor(50, 290);
139139
display.setTextSize(3);
140-
display.print(F("Welcome to Inkplate 6 weather example!"));
140+
display.print(F("Welcome to Inkplate 10 weather example!"));
141141
display.display();
142142

143143
// Wait a bit before proceeding

examples/Inkplate10/Projects/Daily_Weather_Station_Example/Network.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,6 @@ bool Network::getData(char *city, char *temp1, char *temp2, char *temp3, char *t
169169
{
170170
char temp[48];
171171
strcpy(temp, doc["list"][i]["dt_txt"]);
172-
Serial.println(temp);
173-
174-
175172
if (strstr(temp, "15:00:00")) // Show time in 15:00 for every day
176173
{
177174
struct tm t;

examples/Inkplate10/Projects/Hourly_Weather_Station_Example/Network.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -198,12 +198,6 @@ bool Network::getData(char *city, char *temp1, char *temp2, char *temp3, char *t
198198
strcpy(abbr4, doc["hourly"][3]["weather"][0]["icon"].as<const char *>());
199199
;
200200

201-
Serial.println(abbr1);
202-
Serial.println(abbr2);
203-
Serial.println(abbr3);
204-
Serial.println(abbr4);
205-
Serial.println();
206-
207201
f = 0;
208202
}
209203
}

examples/Inkplate6/Projects/Daily_Weather_Station_Example/Daily_Weather_Station_Example.ino

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ char lat[] = "45.5510548";
3535
char lon[] = "18.695463";
3636

3737
// Change to your wifi ssid and password
38-
char ssid[] = "";
39-
char pass[] = "";
38+
char ssid[] = "Besest";
39+
char pass[] = "12345678";
4040

4141
// Uncomment this for MPH and Fahrenheit output, also uncomment it in the begining of Network.cpp
4242
// #define AMERICAN
4343

4444
// Change to your api key, if you don't have one, head over to:
4545
// https://openweathermap.org/guide , register and copy the key provided
46-
char apiKey[] = "";
46+
char apiKey[] = "bf11bcaae795116ccc21beec25850aa0";
4747

4848
//----------------------------------
4949

@@ -195,7 +195,7 @@ void drawWeather()
195195
display.setTextColor(BLACK, WHITE);
196196
display.setFont(&Inter16pt7b);
197197
display.setTextSize(1);
198-
display.setCursor(40, 270);
198+
display.setCursor(80, 210);
199199
display.println(currentWeather);
200200
}
201201

examples/Inkplate6/Projects/Hourly_Weather_Station_Example/Hourly_Weather_Station_Example.ino

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,19 @@ int timeZone = 2;
3131
char city[128] = "OSIJEK";
3232

3333
// Coordinates sent to the api
34-
char lon[] = "45.5510548";
35-
char lat[] = "18.5947808";
34+
char lat[] = "45.5510548";
35+
char lon[] = "18.5947808";
3636

3737
// Change to your wifi ssid and password
38-
char ssid[] = "";
39-
char pass[] = "";
38+
char ssid[] = "Besest";
39+
char pass[] = "12345678";
4040

4141
// Uncomment this for MPH and Fahrenheit output, also uncomment it in the begining of Network.cpp
4242
// #define AMERICAN
4343

4444
// Change to your api key, if you don't have one, head over to:
4545
// https://openweathermap.org/guide , register and copy the key provided
46-
char apiKey[] = "";
46+
char apiKey[] = "bf11bcaae795116ccc21beec25850aa0";
4747

4848
//----------------------------------
4949

@@ -204,7 +204,7 @@ void drawWeather()
204204
display.setTextColor(BLACK, WHITE);
205205
display.setFont(&Roboto_Light_36);
206206
display.setTextSize(1);
207-
display.setCursor(40, 270);
207+
display.setCursor(80, 210);
208208
display.println(currentWeather);
209209
}
210210

examples/Inkplate6/Projects/Hourly_Weather_Station_Example/Network.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -198,12 +198,6 @@ bool Network::getData(char *city, char *temp1, char *temp2, char *temp3, char *t
198198
strcpy(abbr4, doc["hourly"][3]["weather"][0]["icon"].as<const char *>());
199199
;
200200

201-
Serial.println(abbr1);
202-
Serial.println(abbr2);
203-
Serial.println(abbr3);
204-
Serial.println(abbr4);
205-
Serial.println();
206-
207201
f = 0;
208202
}
209203
}

examples/Inkplate6COLOR/Projects/Daily_Weather_Station_Example/Daily_Weather_Station_Example.ino

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ char lat[] = "45.5510548";
3434
char lon[] = "18.695463";
3535

3636
// Change to your wifi ssid and password
37-
char ssid[] = "";
38-
char pass[] = "";
37+
char ssid[] = "Besest";
38+
char pass[] = "12345678";
3939

4040
// Uncomment this for MPH and Fahrenheit output, also uncomment it in the begining of Network.cpp
4141
// #define AMERICAN
4242

4343
// Change to your api key, if you don't have one, head over to:
4444
// https://openweathermap.org/guide , register and copy the key provided
45-
char apiKey[] = "";
45+
char apiKey[] = "bf11bcaae795116ccc21beec25850aa0";
4646
// ----------------------------------
4747

4848
// Include Inkplate library to the sketch
@@ -129,7 +129,7 @@ void setup()
129129
// Welcome screen
130130
display.setCursor(50, 290);
131131
display.setTextSize(3);
132-
display.print(F("Welcome to Inkplate 6 weather example!"));
132+
display.print(F("Welcome to Inkplate 6 COLOR weather example!"));
133133
display.display();
134134
display.setTextSize(3);
135135
// Wait a bit before proceeding
@@ -175,14 +175,14 @@ void drawWeather()
175175
{
176176
// If found draw specified icon
177177
if (strcmp(abbrs[i], currentWeatherAbbr) == 0)
178-
display.drawBitmap(10, 10, logos[i], 152, 152, INKPLATE_ORANGE);
178+
display.drawBitmap(10, 10, logos[i], 152, 152, INKPLATE_BLUE);
179179
}
180180

181181
// Draw weather state
182182
display.setTextColor(INKPLATE_BLUE);
183183
display.setFont(&Inter16pt7b);
184184
display.setTextSize(1);
185-
display.setCursor(150, 50);
185+
display.setCursor(50, 190);
186186
display.println(currentWeather);
187187
}
188188

@@ -203,7 +203,7 @@ void drawCity()
203203
{
204204
// Drawing city name
205205
display.setTextColor(INKPLATE_BLUE);
206-
display.setFont(&Inter16pt7b);
206+
display.setFont(&Inter12pt7b);
207207
display.setTextSize(1);
208208

209209
display.setCursor(300 - 9 * strlen(city), 430);
@@ -228,7 +228,7 @@ void drawTemps()
228228

229229
display.setFont(&Inter16pt7b);
230230
display.setTextSize(1);
231-
display.setTextColor(INKPLATE_BLUE);
231+
display.setTextColor(INKPLATE_YELLOW);
232232

233233
int dayOffset = 40;
234234

@@ -244,12 +244,11 @@ void drawTemps()
244244
display.setCursor(4 * rectSpacing + 3 * rectWidth + textMargin, yRectangleOffset + textMargin + dayOffset);
245245
display.println(wDays[hours + 3 > 6 ? hours + 3 - 6 : hours + 3]);
246246

247-
int tempOffset = 120;
247+
int tempOffset = 80;
248248

249249
// Drawing temperature values into black rectangles
250250
display.setFont(&Inter16pt7b);
251251
display.setTextSize(1);
252-
display.setTextColor(INKPLATE_BLUE);
253252

254253
display.setCursor(1 * rectSpacing + 0 * rectWidth + textMargin, yRectangleOffset + textMargin + tempOffset);
255254
display.print(temps[0]);
@@ -274,31 +273,31 @@ void drawTemps()
274273
// If found draw specified icon
275274
if (strcmp(abbr1, abbrs[i]) == 0)
276275
display.drawBitmap(1 * rectSpacing + 0 * rectWidth + textMargin, yRectangleOffset + textMargin + iconOffset,
277-
s_logos[i], 48, 48, INKPLATE_WHITE, INKPLATE_BLACK);
276+
s_logos[i], 48, 48, INKPLATE_YELLOW, INKPLATE_BLACK);
278277
}
279278

280279
for (int i = 0; i < 18; ++i)
281280
{
282281
// If found draw specified icon
283282
if (strcmp(abbr2, abbrs[i]) == 0)
284283
display.drawBitmap(2 * rectSpacing + 1 * rectWidth + textMargin, yRectangleOffset + textMargin + iconOffset,
285-
s_logos[i], 48, 48, INKPLATE_WHITE, INKPLATE_BLACK);
284+
s_logos[i], 48, 48, INKPLATE_YELLOW, INKPLATE_BLACK);
286285
}
287286

288287
for (int i = 0; i < 18; ++i)
289288
{
290289
// If found draw specified icon
291290
if (strcmp(abbr3, abbrs[i]) == 0)
292291
display.drawBitmap(3 * rectSpacing + 2 * rectWidth + textMargin, yRectangleOffset + textMargin + iconOffset,
293-
s_logos[i], 48, 48, INKPLATE_WHITE, INKPLATE_BLACK);
292+
s_logos[i], 48, 48, INKPLATE_YELLOW, INKPLATE_BLACK);
294293
}
295294

296295
for (int i = 0; i < 18; ++i)
297296
{
298297
// If found draw specified icon
299298
if (strcmp(abbr4, abbrs[i]) == 0)
300299
display.drawBitmap(4 * rectSpacing + 3 * rectWidth + textMargin, yRectangleOffset + textMargin + iconOffset,
301-
s_logos[i], 48, 48, INKPLATE_WHITE, INKPLATE_BLACK);
300+
s_logos[i], 48, 48, INKPLATE_YELLOW, INKPLATE_BLACK);
302301
}
303302
}
304303

@@ -312,7 +311,7 @@ void drawCurrent()
312311
display.setTextSize(1);
313312
display.setTextColor(INKPLATE_BLUE);
314313

315-
display.setCursor(150, 150);
314+
display.setCursor(160, 145);
316315
display.print(currentTemp);
317316

318317
int x = display.getCursorX();
@@ -329,7 +328,7 @@ void drawCurrent()
329328
display.setTextSize(1);
330329
display.setTextColor(INKPLATE_BLUE);
331330

332-
display.setCursor(350, 150);
331+
display.setCursor(360, 145);
333332
display.print(currentWind);
334333

335334
x = display.getCursorX();

examples/Inkplate6COLOR/Projects/Daily_Weather_Station_Example/Network.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,6 @@ bool Network::getData(char *city, char *temp1, char *temp2, char *temp3, char *t
169169
{
170170
char temp[48];
171171
strcpy(temp, doc["list"][i]["dt_txt"]);
172-
Serial.println(temp);
173-
174-
175172
if (strstr(temp, "15:00:00")) // Show time in 15:00 for every day
176173
{
177174
struct tm t;

0 commit comments

Comments
 (0)