9.10 Arduino Ultrasonic Functions

9.10.1 @ultrasonic/delete

: delete (dev)

Free resources of a ultrasonic object.

Inputs

dev - ultrasonic object to free

See also: ultrasonic.

9.10.2 @ultrasonic/display

: display (dev)

Display ultrasonic object.

Inputs

dev - ultrasonic object to display

See also: ultrasonic.

9.10.3 @ultrasonic/readDistance

: distance = readDistance (dev)

Read the distance from a ultrasonic device

Inputs

dev - connected ultrasonic device opened using ultrasonic

Outputs

distance - distance value in meters from the ultrasonic device, or Inf if out of sensor range

See also: arduino, ultrasonic.

9.10.4 @ultrasonic/readEchoTime

: time = readEchoTime (dev)

Measure the time for waves to reflect back to the ultrasonic device

Inputs

dev - connected ultrasonic device opened using ultrasonic()

Outputs

time - time in seconds, or Inf if out of sensor range

See also: arduino, ultrasonic.

9.10.5 @ultrasonic/subsref

: val = subsref (dev, sub)

subref for ultrasonic

See also: ultrasonic.

9.10.6 @ultrasonic/ultrasonic

: dev = ultrasonic (ar, triggerpin)
: dev = ultrasonic (ar, triggerpin, echopin)
: dev = ultrasonic (ar, triggerpin, echopin, propname, propvalue)

Create an ultrasonic object to communicate to a connected ultrasonic device

Inputs

ar - connected arduino object

triggerpin - trigger pin for attached device.

echopin - trigger pin for attached device.

propname, propvalue - property name/value pair for values to pass to devices.

Currently known properties:

outputformat

string designating number format for output (’double’)

Outputs

dev - created ultrasonic object

Properties

The ultrasonic object has the following public properties:

parent

The parent (arduino) for this device

pins

pins used by this object

triggerpin

trigger used for created object

echopin

Echo pin set for object

outputformat

Output format for the created object

See also: arduino, readDistance, readEchoTime.


Next: Arduino Addons, Previous: Arduino Device Functions, Up: Function Reference   [Contents][Index]