[SOLVED] DI Distance Sensor with the GrovePi+

I have both a GoPiGo3 and a new GrovePi+. I also have this distance sensor:
https://www.dexterindustries.com/shop/distance-sensor/
The sensor works fine with the GPG3 using this program:
GoPiGo3/Software/Python/Examples/easy_Distance_sensor.py
I installed BOTH GrovePi+ and GPG3 software onto the GrovePi+ and tried to run the same ppm
there but it failed. The errors depend on whether I run with Python2 or Python3. With Py2 it said:

FATAL ERROR:
GoPiGo3 is not detected.
Traceback (most recent call last):
File “easy_Distance_Sensor.py”, line 39, in
gpg = easy.EasyGoPiGo3()
File “build/bdist.linux-armv7l/egg/easygopigo3.py”, line 110, in init
IOError: No SPI response. GoPiGo3 with address 8 not connected.

Is there a simple program for the GrovePi+ that handles the sensor like the one for the GPG3??
I will be doing similar things with a GPS and an IMU.
Thank you for your help.

Hi @rbutler,

The distance sensor works fine on the GrovePi as the sensor is just an I2C device, so there’s no intermediary between the Pi and itself.

In your case, that code won’t work as it’s specifically made to work with a GoPiGo3. What you need is to have the regular DI_Sensors installed on your Pi. Here’s a quick-start:

http://di-sensors.readthedocs.io/en/master/quickstart.html

In this documentation, you’ll find everything to get going with the distance sensor. Here’s an example of a program:

http://di-sensors.readthedocs.io/en/master/examples/dist_sensor.html

Thank you!

Thank you.
I will work on this tomorrow.

I tried it today and it worked great. Thanks very much. :slight_smile: