Nerves.Grove v0.5.0 Nerves.Grove.Relay

Seeed Studio Grove Relay

Example

alias Nerves.Grove.Relay

{:ok, pid} = Relay.start_link(pin)

Relay.on(pid)   # start current flow
Relay.off(pid)  # stop current flow

Summary

Functions

Switches off the relay, preventing current from flowing

Switches on the relay, enabling current to flow

Functions

off(pid)

Specs

off(pid) :: any

Switches off the relay, preventing current from flowing.

on(pid)

Specs

on(pid) :: any

Switches on the relay, enabling current to flow.

start_link(pin)

Specs

start_link(pos_integer) :: {:ok, pid} | {:error, any}