diff --git a/org.fortiss.af3.platform.raspberry/trunk/lib/src/LaserRangeFinder.c b/org.fortiss.af3.platform.raspberry/trunk/lib/src/LaserRangeFinder.c index 93eb8c417a348a05a3a046db97adc471e3854258..87c80295fc864c2b2e7daecde40f23b6986b04fd 100644 --- a/org.fortiss.af3.platform.raspberry/trunk/lib/src/LaserRangeFinder.c +++ b/org.fortiss.af3.platform.raspberry/trunk/lib/src/LaserRangeFinder.c @@ -88,9 +88,15 @@ GEN_TYPE_int lrf_read() { } } else { d = atoi(value); - printf("%d\n",d); - timeout = 0; - return d; + if (d != 0) { + printf("%d\n", d); + timeout = 0; + return d; + } else { + timeout++; + printf("-1: zero value\n"); + return -1; + } } } }