- ID: ultrasonic 
 
- Name: Grove Ultrasonic Ranger 
 
- Category: sound 
 
- Manufacturer: seeed 
 
- Connection: gpio
 
This Grove Ultrasonic sensor is a non-contact distance measurement module which is compatible with the Grove system. It is designed for easy modular project usage with industrial performance. Detection ranges from 3 cm (1.2")
to 4 m (13'1.5") and works best when the object is within a 30 degree angle relative to the sensor.
     
    while(running)
    {
        int width = sonar->getDistance();
        printf("Echo width = %d\n", width);
        printf("Distance inches = %f.2\n\n", width/148.0);
        sleep(3);
    }