From d670b753dc6ce99ec78d43f4b81c534cc062f268 Mon Sep 17 00:00:00 2001 From: Kai Lauterbach Date: Mon, 23 May 2022 13:10:15 +0200 Subject: [PATCH] Added staus led toggle code --- firmware/firmware.ino | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/firmware/firmware.ino b/firmware/firmware.ino index aaa62ec..f72329a 100644 --- a/firmware/firmware.ino +++ b/firmware/firmware.ino @@ -226,11 +226,14 @@ void _loop() { debug("Reading wind sensor because of exceed call functionality"); if (sensors[SENSOR_WINDSPEED]) { - // read from windspeed sensor + // read from windspeed sensorSTATUS_LED_PIN + digitalWrite(STATUS_LED_PIN, HIGH); currentSensorData[SENSOR_WINDSPEED] = sensors[SENSOR_WINDSPEED](); + digitalWrite(STATUS_LED_PIN, LOW); if (currentSensorData[SENSOR_WINDSPEED] >= HTTP_CALL_ON_WINDSPEED_EXCEED_MPS) { + digitalWrite(STATUS_LED_PIN, HIGH); // call the url HTTP_CALL_ON_WINDSPEED_URL WiFiClient client; HTTPClient http; @@ -239,6 +242,7 @@ void _loop() { // Send HTTP GET request int httpResponseCode = http.GET(); debug("Called windspeed exceed callout"); + digitalWrite(STATUS_LED_PIN, LOW); } } else { currentSensorData[SENSOR_WINDSPEED] = nan("no value");