From af23a999ba9eb62a88dc981f49f0967a70e1fd5d Mon Sep 17 00:00:00 2001 From: Kunal Powar Date: Sat, 5 Apr 2014 01:45:11 +0530 Subject: [PATCH] us020: make the state comparisons clearer --- sensor/us020/us020.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 } }