Skip to content

Commit

Permalink
add optional activity LED
Browse files Browse the repository at this point in the history
  • Loading branch information
kmetz committed Sep 16, 2020
1 parent 9cb2226 commit baeb36f
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion coro2sens/coro2sens.ino
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@
// Label describing the time axis.
#define TIME_LABEL "1 hour"

// Activity indicator LED (use the built-in LED if your board has one).
//#define ACTIVITY_LED_PIN 5

// =============================================================================


Expand Down Expand Up @@ -149,7 +152,10 @@ void setup() {

// Initialize pins.
pinMode(BUZZER_PIN, OUTPUT);
pinMode(SWITCH_PIN, OUTPUT);
#if defined(ACTIVITY_LED_PIN)
pinMode(ACTIVITY_LED_PIN, OUTPUT);
digitalWrite(ACTIVITY_LED_PIN, HIGH);
#endif

// Initialize LED(s).
FastLED.addLeds<LED_CHIPSET, LED_PIN, LED_COLOR_ORDER>(leds, NUM_LEDS);
Expand Down Expand Up @@ -231,6 +237,10 @@ void loop() {
return;
}

#if defined(ACTIVITY_LED_PIN)
digitalWrite(ACTIVITY_LED_PIN, LOW);
#endif

// Read sensors.
if (bme280isConnected) {
pressure = (uint16_t) (bme280.readFloatPressure() / 100);
Expand Down Expand Up @@ -286,6 +296,10 @@ void loop() {
alarmHasTriggered = false;
}

#if defined(ACTIVITY_LED_PIN)
digitalWrite(ACTIVITY_LED_PIN, HIGH);
#endif

lastMeasureTime = millis();
}

Expand Down

0 comments on commit baeb36f

Please sign in to comment.