Hi,
i’m trying to use the ultrasonic ranger SEN10737P on my Raspberry. It’s connected to a GrovePi. I’m using the following code :
`
GrovePi + Grove Ultrasonic Ranger
import time
from grovepi import *
Connect the Grove Ultrasonic Ranger to digital port D4
SIG,NC,VCC,GND
ultrasonic_ranger = 4
while True:
try:
# Read distance value from Ultrasonic
print ultrasonicRead(ultrasonic_ranger)
time.sleep(1)
except TypeError:
print "Error"
except IOError:
print “Error”
But, instead of giving me the distance, i’ve got something like 1, 2, 5 , 0 , 1054, 784.
In short, it sometimes gives me the right distance, but every 2 or 3 distances, he sends me a random number.