Skip to content

Commit 4f3c3ea

Browse files
committed
show warning on display if air quality is too bad
1 parent 7448f0e commit 4f3c3ea

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

src/config.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
33

44
#define PASSWORD "waaatering"
5+
6+
int CO2_WARN_PPM = 1200;

src/main.cpp

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -472,8 +472,11 @@ void loop()
472472
appState = 1;
473473

474474
display.clearDisplay();
475+
display.setTextSize(1);
476+
475477
display.setCursor(0, 0);
476478
display.print("preheating...");
479+
477480
display.display();
478481
}
479482
}
@@ -493,15 +496,23 @@ void loop()
493496
Serial.println(lastCo2Value);
494497

495498
display.clearDisplay();
499+
display.setTextSize(1);
496500

501+
display.setCursor(0, 0);
497502
display.print("temp: ");
498503
display.print(lastTemperature);
499504

500-
display.setCursor(10, 0);
501-
505+
display.setCursor(0, 10);
502506
display.print("co2: ");
503507
display.print(lastCo2Value);
504508

509+
if (lastCo2Value >= CO2_WARN_PPM)
510+
{
511+
display.setCursor(0, 40);
512+
display.setTextSize(2);
513+
display.print("L Ü F T E N");
514+
}
515+
505516
display.display();
506517

507518
lastCo2Measurement = millis();

0 commit comments

Comments
 (0)