The Ping))) object provides the distance from the sensor connected to an I/O pin through a 3.3k to 4.7k resistor. The object returns the distance in microseconds, or a 0 value if missing or bad sensor. The example uses smart pins and can be replicated for as many Ping))) sensors as needed. The values are provided in inches, tenths of inches, millimeters, and centimeters. The LaserPING 2m Rangefinder is also compatible with this code example.
Two source code archives are included. The first archive is a test with a terminal program and the second archive is a demonstration using the graphical debug features built into Propeller Tool for Windows.