|Demand Peripherals Robotics and Automation Made Easy|
US8: Octal Ultrasonic Distance Sensor
The US8 peripheral gives you eight channels of distance measurement using the SRF04 ultrasonic distance sensor.
The us8 peripheral uses a us8 card to connect to up to eight SRF-04 ultrasonic sensors. The sensors have one input pin and one output pin. A 10 us pulse on the input starts a ping. The echo time of the ping is given as a pulse width on the output pin. The echo response starts about 100 us after the end of the start pulse. The FPGA measures the pulse width of the echo reply and does an auto-send of that time up to the host. To avoid multiple echoes the peripheral pings only one sensor at a time with pings sent every 60 millisecond.
You can select which sensors are enabled. The scan rate per sensor is faster if you disable unused sensors.
More information about the US8 card is available here cards/us8.html.
enable : enable/disable sensors.
distance : stream of sensor ID and distances.
The output is a digit that indicates the sensor number followed by the distance in units of one-tenth of an inch. The sensor ID and readings are separated by a space and terminated by a newline. A distance of zero indicates that the sensor is not connected or is not responding. Typical output from the distance resource might appear as:
0 1055 1 55 2 0 3 1848 0 1094
Enable the first four distance sensors and start a data stream of distance measurements.
dpset us8 enable 0f dpcat us8 distance