From 19a4a314afd9a29fe64e81c764bc832c246c37a2 Mon Sep 17 00:00:00 2001 From: chl33 <64091421+chl33@users.noreply.github.com> Date: Thu, 19 Sep 2024 17:49:39 -0400 Subject: [PATCH] Only use plant1 for LED-blink control. Version -> 0.7.1 (#7) * LED blinking only for plant0 * update dependencies, version -> 0.7.1 --- lib/watering/watering.cpp | 16 +++++++++------- platformio.ini | 6 +++--- src/main.cpp | 2 +- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/lib/watering/watering.cpp b/lib/watering/watering.cpp index fc21caa..33ffd5e 100644 --- a/lib/watering/watering.cpp +++ b/lib/watering/watering.cpp @@ -211,13 +211,15 @@ void Watering::loop() { } #endif m_moisture.read(nowMsec); - const float level = m_moisture.filteredValue(); - if (level > m_max_moisture_target.value()) { - m_mode_led.delayedBlink(2000, 2); - } else if (level < m_min_moisture_target.value()) { - m_mode_led.delayedBlink(2000, 3); - } else { - m_mode_led.delayedBlink(2000, 1); + if (m_index == 0) { + const float level = m_moisture.filteredValue(); + if (level > m_max_moisture_target.value()) { + m_mode_led.delayedBlink(2000, 2); + } else if (level < m_min_moisture_target.value()) { + m_mode_led.delayedBlink(2000, 3); + } else { + m_mode_led.delayedBlink(2000, 1); + } } } diff --git a/platformio.ini b/platformio.ini index ea269f8..53d28e1 100644 --- a/platformio.ini +++ b/platformio.ini @@ -28,9 +28,9 @@ build_type = release ; ~/Projects2/Plant133/lib/watering lib_deps = watering - og3@0.2.0 - og3x-oled@0.1.3 - og3x-shtc3@0.2.0 + og3@^0.2.0 + og3x-oled@^0.2.0 + og3x-shtc3@^0.2.0 adafruit/Adafruit BusIO adafruit/Adafruit SHTC3 Library adafruit/Adafruit Unified Sensor diff --git a/src/main.cpp b/src/main.cpp index 7c9ba9a..9b1a15f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -16,7 +16,7 @@ #include "watering.h" -#define SW_VERSION "0.7.0" +#define SW_VERSION "0.7.1" namespace {