sensor conversion time set to min 1 sec.

This commit is contained in:
MichaelDvP
2020-07-05 13:37:34 +02:00
parent d9fd27c22b
commit 627807d57f
2 changed files with 2 additions and 1 deletions

View File

@@ -73,7 +73,7 @@ void Sensors::loop() {
last_activity_ = time_now;
}
} else if (state_ == State::READING) {
if (temperature_convert_complete()) {
if (temperature_convert_complete() && (time_now - last_activity_ > CONVERSION_MS)) {
// LOG_DEBUG(F("Scanning for sensors")); // uncomment for debug
bus_.reset_search();
found_.clear();

View File

@@ -89,6 +89,7 @@ class Sensors {
static constexpr uint8_t TYPE_DS1825 = 0x3B;
static constexpr uint32_t READ_INTERVAL_MS = 5000; // 5 seconds
static constexpr uint32_t CONVERSION_MS = 1000; // 1 seconds
static constexpr uint32_t READ_TIMEOUT_MS = 2000; // 2 seconds
static constexpr uint32_t SCAN_TIMEOUT_MS = 30000; // 30 seconds