fix for wrong stupid logic

This commit is contained in:
to-scho 2022-01-18 15:42:45 +01:00
parent 0930f4679c
commit 6b8fc2d550
1 changed files with 1 additions and 1 deletions

View File

@ -53,7 +53,7 @@ uint8_t Sr04TModeDetect(void)
if (sonar_serial->begin(9600)) {
DEBUG_SENSOR_LOG(PSTR("SR4: Detect mode"));
if (! PinUsed(GPIO_SR04_TRIG)) {
if (PinUsed(GPIO_SR04_TRIG)) {
sr04_type = (Sr04TMiddleValue(Sr04TMode3Distance(), Sr04TMode3Distance(), Sr04TMode3Distance()) != NO_ECHO) ? 3 : 1;
} else {
sr04_type = 2;