@@ -300,6 +300,7 @@ void setupDisplay()
300
300
display.setTextSize (1 );
301
301
display.setCursor (0 , 0 );
302
302
display.print (" >> co2 meter <<" );
303
+
303
304
display.display ();
304
305
}
305
306
@@ -309,6 +310,8 @@ void setupOTA()
309
310
.setHostname (WiFiSettings.hostname .c_str ())
310
311
.setPassword (WiFiSettings.password .c_str ())
311
312
.onStart ([]() {
313
+ isUpdating = true ;
314
+
312
315
String type;
313
316
314
317
if (ArduinoOTA.getCommand () == U_FLASH)
@@ -323,7 +326,11 @@ void setupOTA()
323
326
// NOTE: if updating FS this would be the place to unmount FS using FS.end()
324
327
Serial.println (" Start updating " + type);
325
328
326
- isUpdating = true ;
329
+ display.clearDisplay ();
330
+ display.setTextSize (2 );
331
+ display.print (" updating..." );
332
+
333
+ display.display ();
327
334
})
328
335
.onEnd ([]() {
329
336
Serial.println (" \n End" );
@@ -332,6 +339,18 @@ void setupOTA()
332
339
})
333
340
.onProgress ([](unsigned int progress, unsigned int total) {
334
341
Serial.printf (" Progress: %u%%\r " , (progress / (total / 100 )));
342
+
343
+ display.clearDisplay ();
344
+
345
+ display.setCursor (0 , 0 );
346
+ display.setTextSize (2 );
347
+ display.print (" updating..." );
348
+
349
+ display.setCursor (0 , 40 );
350
+ display.print (progress);
351
+ display.print (" %" );
352
+
353
+ display.display ();
335
354
})
336
355
.onError ([](ota_error_t error) {
337
356
Serial.printf (" Error[%u]: " , error);
@@ -496,21 +515,20 @@ void loop()
496
515
Serial.println (lastCo2Value);
497
516
498
517
display.clearDisplay ();
499
- display.setTextSize (1 );
518
+ display.setTextSize (2 );
500
519
501
520
display.setCursor (0 , 0 );
502
- display.print (" temp: " );
503
- display.print (lastTemperature);
504
521
505
522
display.setCursor (0 , 10 );
506
- display.print (" co2 : " );
523
+ display.print (" CO2 : " );
507
524
display.print (lastCo2Value);
525
+ display.print (" ppm" );
508
526
509
527
if (lastCo2Value >= CO2_WARN_PPM)
510
528
{
511
529
display.setCursor (0 , 40 );
512
530
display.setTextSize (2 );
513
- display.print (" L Ü F T E N " );
531
+ display.print (" VENTILATE " );
514
532
}
515
533
516
534
display.display ();
0 commit comments