Removed timeout
This commit is contained in:
parent
1fad63a84d
commit
ab480041b2
@ -115,7 +115,7 @@
|
|||||||
#define MAX_JSON_CONFIG_FILE_SIZE_CUSTOM 2500
|
#define MAX_JSON_CONFIG_FILE_SIZE_CUSTOM 2500
|
||||||
|
|
||||||
#define TEMPERATUR_TIMEOUT 3000 /**< 3 Seconds timeout for the temperatures sensors */
|
#define TEMPERATUR_TIMEOUT 3000 /**< 3 Seconds timeout for the temperatures sensors */
|
||||||
#define WATERSENSOR_TIMEOUT 2000 /**< 2 Seconds timeout for the water distance sensor */
|
#define WATERSENSOR_TIMEOUT 3000 /**< 3 Seconds timeout for the water distance sensor */
|
||||||
#define WATERSENSOR_CYCLE 5 /**< 5 sensor measurement are performed */
|
#define WATERSENSOR_CYCLE 5 /**< 5 sensor measurement are performed */
|
||||||
#define DS18B20_RESOLUTION 9 /**< 9bit temperature resolution -> 0.5°C steps */
|
#define DS18B20_RESOLUTION 9 /**< 9bit temperature resolution -> 0.5°C steps */
|
||||||
|
|
||||||
|
@ -329,12 +329,13 @@ void readPowerSwitchedSensors()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Wire.begin(SENSOR_TANK_SDA, SENSOR_TANK_SCL, 100000UL /* 100kHz */);
|
Wire.begin(SENSOR_TANK_SDA, SENSOR_TANK_SCL);
|
||||||
tankSensor.setTimeout(500);
|
// Source: https://www.st.com/resource/en/datasheet/vl53l0x.pdf
|
||||||
|
tankSensor.setAddress(0x52);
|
||||||
tankSensor.setBus(&Wire);
|
tankSensor.setBus(&Wire);
|
||||||
|
delay(50);
|
||||||
long start = millis();
|
long start = millis();
|
||||||
bool distanceReady = false;
|
bool distanceReady = false;
|
||||||
delay(50);
|
|
||||||
while ((start + WATERSENSOR_TIMEOUT) > millis())
|
while ((start + WATERSENSOR_TIMEOUT) > millis())
|
||||||
{
|
{
|
||||||
if (tankSensor.init())
|
if (tankSensor.init())
|
||||||
@ -344,7 +345,7 @@ void readPowerSwitchedSensors()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
delay(20);
|
delay(200);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (distanceReady)
|
if (distanceReady)
|
||||||
|
Loading…
Reference in New Issue
Block a user