mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-24 11:16:34 +00:00
[SR04] fix mode 1 detection
Detection of sensors running in mode 1 fixed.
This commit is contained in:
parent
06c33d34ef
commit
bcf2bc5cf1
@ -136,6 +136,7 @@ void Sr04TModeDetect(void) {
|
||||
sonar_serial = nullptr;
|
||||
}
|
||||
sonar = new NewPing(sr04_trig_pin, sr04_echo_pin, SR04_MAX_SENSOR_DISTANCE);
|
||||
delay(100); // give time to inizialise, preventing ping_median fails
|
||||
if (!sonar || !sonar->ping_median(5)) {
|
||||
SR04.type = SR04_MODE_NONE;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user