DYPA01 (dypa01 v0.1.0) View Source

Measure distance with DYP-A01 ultrasonic distance sensor.

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor.

Measure the current distance.

Start a new GenServer for interacting with a DYPA01 sensor.

Link to this section Types

Specs

options() :: [GenServer.option() | {:port_name, String.t()}]

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Specs

measure(GenServer.server()) :: {:ok, DYPA01.Measurement.t()} | {:error, any()}

Measure the current distance.

Link to this function

start_link(init_arg \\ [])

View Source

Specs

start_link(options()) :: GenServer.on_start()

Start a new GenServer for interacting with a DYPA01 sensor.

Examples

{:ok, pid} = DYPA01.start_link(port_name: "ttyAMA0")