diff options
| author | Sam Anthony <sam@samanthony.xyz> | 2024-11-29 13:07:09 -0500 |
|---|---|---|
| committer | Sam Anthony <sam@samanthony.xyz> | 2024-11-29 13:07:09 -0500 |
| commit | 8b05f053c42336caa595c77e142e0317bc915cce (patch) | |
| tree | bee79f573257d9369cad8954c4c7d476c17bd7f3 /HvacStation | |
| parent | fa9a838eda2de684183d2ca05b4c7bf0cdc64a20 (diff) | |
| download | soen422-8b05f053c42336caa595c77e142e0317bc915cce.zip | |
HvacStation: low/high indicator LEDs
Diffstat (limited to 'HvacStation')
| -rw-r--r-- | HvacStation/HvacStation.ino | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/HvacStation/HvacStation.ino b/HvacStation/HvacStation.ino index a20d986..598958b 100644 --- a/HvacStation/HvacStation.ino +++ b/HvacStation/HvacStation.ino @@ -16,7 +16,10 @@ enum times { enum pins { SOLENOID_PIN = 23, - // 74HC595 shift register inputs: (for LED bar) + LO_LED = 12, // Lit when measured humidity is below target. + HI_LED = 14, // Lit when measured humidity is above target. + + // 74HC595 shift register inputs; (for LED bar): REG_CLR = 25, // Clear; active low. REG_SH = 4, // Shift; active rising. REG_ST = 0, // Store; active rising. @@ -56,6 +59,8 @@ setup(void) { int i; pinMode(SOLENOID_PIN, OUTPUT); + pinMode(LO_LED, OUTPUT); + pinMode(HI_LED, OUTPUT); pinMode(REG_CLR, OUTPUT); pinMode(REG_SH, OUTPUT); pinMode(REG_ST, OUTPUT); @@ -117,6 +122,8 @@ loop(void) { lastDisplayUpdate = now; refreshDisplay(target, humidity, dutycycle); refreshLedBar(dutycycle); + digitalWrite(LO_LED, (humidity < target) ? HIGH : LOW); + digitalWrite(HI_LED, (humidity > target) ? HIGH : LOW); } } |