Skip to content

Commit 34d3752

Browse files
committed
Add CO2 level check to LED control logic
1 parent fb0c0a1 commit 34d3752

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

.github/workflows/arduino_build.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ jobs:
2727
source-path: ./esp32-waveshare-epd
2828
sketch-paths: |
2929
- .
30+
cli-compile-flags: |
31+
--build-property
32+
build.f_cpu=80000000L
3033
3134
- name: Stage firmware into ./build/... and rename to FIRMWARE.BIN
3235
shell: bash

OpenCO2_Sensor.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,7 @@ void getColor(uint16_t co2, int* red, int* green, int* blue) {
421421
void setLED(uint16_t co2) {
422422
updateBatteryMode();
423423
if ((BatteryMode && !LEDonBattery)
424+
|| (co2 < 1000)
424425
|| (!BatteryMode && !LEDonUSB)) {
425426
if (HWSubRev == 3) digitalWrite(LED_POWER, LOW); // LED OFF
426427
else digitalWrite(LED_POWER, HIGH); // LED OFF

0 commit comments

Comments
 (0)