NXC  Version 1.2.1 r5
 All Data Structures Files Functions Variables Groups Pages
byte SensorUSWait ( const byte  port,
const byte  wait 

Read ultrasonic sensor value with specified wait.

Return the ultrasonic sensor distance value. Since an ultrasonic sensor is an I2C digital sensor its value cannot be read using the standard Sensor(n) value. The port must be configured as a Lowspeed port before using this function.

portThe port to which the ultrasonic sensor is attached. See the Input port constants group. You may use a constant or a variable.
waitThe number of milliseconds to wait before querying the sensor. You may use a constant or a variable.
The ultrasonic sensor distance value (0..255)