GrovePi v0.6.1 GrovePi.Ultrasonic View Source

Read distance from the Grove Ultrasonic sensor.

Example use:

iex> pin = 3
iex> {:ok, pid} = GrovePi.Ultrasonic.start_link(pin)
{:ok, #PID<0.205.0>}
iex> GrovePi.Ultrasonic.read_distance(pin)
20
iex> GrovePi.Ultrasonic.read_distance(pin)
23

Link to this section Summary

Link to this section Types

Link to this type distance() View Source
distance() :: integer()

Link to this section Functions

Link to this function handle_call(arg, from, state) View Source
Link to this function read_distance(pin, prefix \\ Default) View Source
read_distance(GrovePi.pin(), atom()) :: distance()
Link to this function start_link(pin, opts \\ []) View Source