From c7839b469b5a3dee6711c4d892bb9a002d7d96d2 Mon Sep 17 00:00:00 2001 From: Manuel <71137295+mverch67@users.noreply.github.com> Date: Mon, 11 Mar 2024 18:51:14 +0100 Subject: [PATCH] fix of tryfix SHT31 sensor (#3377) --- src/modules/Telemetry/Sensor/SHT31Sensor.cpp | 1 + src/modules/Telemetry/Sensor/SHT31Sensor.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/Telemetry/Sensor/SHT31Sensor.cpp b/src/modules/Telemetry/Sensor/SHT31Sensor.cpp index 7f2b7691ef..35978d9704 100644 --- a/src/modules/Telemetry/Sensor/SHT31Sensor.cpp +++ b/src/modules/Telemetry/Sensor/SHT31Sensor.cpp @@ -12,6 +12,7 @@ int32_t SHT31Sensor::runOnce() if (!hasSensor()) { return DEFAULT_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS; } + sht31 = Adafruit_SHT31(nodeTelemetrySensorsMap[sensorType].second); status = sht31.begin(nodeTelemetrySensorsMap[sensorType].first); return initI2CSensor(); } diff --git a/src/modules/Telemetry/Sensor/SHT31Sensor.h b/src/modules/Telemetry/Sensor/SHT31Sensor.h index 9700bdf2c7..c6f8f15968 100644 --- a/src/modules/Telemetry/Sensor/SHT31Sensor.h +++ b/src/modules/Telemetry/Sensor/SHT31Sensor.h @@ -5,7 +5,7 @@ class SHT31Sensor : public TelemetrySensor { private: - Adafruit_SHT31 sht31 = Adafruit_SHT31(nodeTelemetrySensorsMap[sensorType].second); + Adafruit_SHT31 sht31; protected: virtual void setup() override;