exred_node_gpio_in v0.2.0 Exred.Node.GPIOIn
Receives data from a GPIO pin.
Uses Elixir ALE to interface with GPIO.
It can work in two modes:
- ‘monitor’: monitors the pin and sends a message on pin interrupt
- ‘read_on_message’: reads the pin state and sends the data when triggered by an incoming message
Incoming message format
Anything
Outgoing message format
read on message mode:
msg = %{
payload :: 0 | 1
}
monitor mode:
msg = %{
payload :: %{
pin_number :: integer,
condition :: :rising | :falling
}
}
Link to this section Summary
Functions
Returns a specification to start this module under a supervisor
daemon_child_specs/1 needs to return a list of child specs. These child processes will be started under the DaemonNodeSupervisor
handle_msg/2 is called whenever the node receives a message from another node. It should return an {outgoing_msg, new_state} tuple
Link to this section Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
daemon_child_specs/1 needs to return a list of child specs. These child processes will be started under the DaemonNodeSupervisor.
Callback implementation for Exred.NodePrototype.daemon_child_specs/1
.
handle_msg/2 is called whenever the node receives a message from another node. It should return an {outgoing_msg, new_state} tuple.
Callback implementation for Exred.NodePrototype.handle_msg/2
.