This is the page for the SRF08 Ultrasonic Ranger, with I2C interface.
It is available at a number of places including :
The datasheet can be found from the Rapid Electronics website, or there is a good resources at Robot Electronics
#include "mbed.h"
#include "SRF08.h"
SRF08 srf08(p9, p10, 0xE0); // Define SDA, SCL pin and I2C address
int main() {
while (1) {
printf("Measured range : %.2f cm\n",srf08.read());
wait(0.1);
}
}
No tags
|
6 comments
Please login to post comments.
If you need a Sonar sensor, you might also consider the Maxbotix EZ series Sonar modules (www.maxbotix.com) . It is smaller and has an analog out, so a single analog in pin can read it. It will run off 3.3V. Phidgets and Robotics Connection also sells them.