In this example we show you how to use a Grove Ultrasonic Ranger to measure distance of an object, using the Raspberry Pi, Arduberry, and the Grove system.
Hardware Required
- Raspberry Pi
- Arduberry
- Grove Base Shield
- Grove Ultrasonic Ranger
Step 1
Slide the Grove Base shield onto the Arduberry. Attach the Ultrasonic Ranger to Port D7.
Power on the Raspberry Pi.
Step 2
Download the Ultrasonic Ranger library using the Netsurf Browser on your Raspberry Pi.
Save the library to /usr/share/Arduino/libraries
Extract the library to the same directory.
Step 3
Open the example UltrasonicDisplayOnTerm from the Ultrasonic folder, in Arduino.
Change the programmer to Raspberry Pi GPIO.
Upload the sketch to the Arduberry it(use Ctrl+Shift+U).
Step 4
Open a new terminal window on the Raspberry Pi.
Start minicom (a serial port terminal) to see the Ultrasonic Ranger data being sent by the Arduberry on the Serial line.
minicom ama0
Have a question? Post it on the forums and we’ll help you out.