diff --git a/sensor/us020/us020.go b/sensor/us020/us020.go index 035ee9d..7d9fddd 100644 --- a/sensor/us020/us020.go +++ b/sensor/us020/us020.go @@ -98,7 +98,7 @@ func (d *US020) Distance() (float64, error) { return 0, err } - if v != embd.Low { + if v == embd.High { break } } @@ -114,7 +114,7 @@ func (d *US020) Distance() (float64, error) { return 0, err } - if v != embd.High { + if v == embd.Low { break } }