PiRelayPlate

This is an Elixir library for the π Relay Plate.

Examples

iex> {:ok, relay} = PiRelayPlate.start()
{:ok,
  %PiRelayPlate{
    options: [
      pp_frame_pin: "GPIO25",
      pp_int_pin: "GPIO22",
      pp_ack_pin: "GPIO23",
      board_id: 0
    ],
    pp_frame: %Circuits.GPIO.CDev{ref: #Reference<...>},
    pp_int: %Circuits.GPIO.CDev{ref: #Reference<...>},
    pp_ack: %Circuits.GPIO.CDev{ref: #Reference<...>},
    spi_ref: %Circuits.SPI.SPIDev{ref: #Reference<...>},
    board_id: 0
  }}
iex> PiRelayPlate.toggle(relay, 1)
:ok
iex> RelayPlate.stop(relay)
:ok

Installation

If available in Hex, the package can be installed by adding pi_relay_plate to your list of dependencies in mix.exs:

def deps do
  [
    {:pi_relay_plate, "~> 0.1.0"}
  ]
end

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/pi_relay_plate.