Skip to content

Commit 932ce09

Browse files
committed
Add CO2 level check to LED control logic
1 parent fb0c0a1 commit 932ce09

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

.github/workflows/arduino_build.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
platforms: |
1818
- name: esp32:esp32
1919
source-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
20-
version: 3.2.0
20+
version: 3.3.5
2121
libraries: |
2222
- name: FastLED
2323
- name: Sensirion Core
@@ -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)