Connection to ultrasonic sensor on Arduino hardware
This object represents a connection to an ultrasonic sensor connected to the Arduino® hardware. To measure the distance to an object with the ultrasonic sensor, use this object with the functions listed in Object Functions.
creates an ultrasonic sensor connection for a three-pin sensor connected to the specified
trigger pin on the Arduino hardware.ultrasonicObj
= ultrasonic(arduinoObj
,triggerPin
)
creates an ultrasonic sensor connection for a four-pin sensor connected to the specified
pins on the Arduino hardware.ultrasonicObj
= ultrasonic(arduinoObj
,triggerPin
,echoPin
)
creates an ultrasonic sensor connection for a four-pin sensor with the specified pins on
Arduino hardware. For a three-pin sensor,the echo pin is the same as the trigger
pin.ultrasonicObj
= ultrasonic(arduinoObj
,triggerPin
,echoPin
,Name,Value
)
readDistance | Distance to object in front of ultrasonic sensor |
readEchoTime | Read echo time of ultrasound waves |