ScrollHat.Buttons (scroll_hat v0.2.1) View Source
Buttons interface for Scroll HAT Mini
Pass a :handler
option as a pid or {m, f, a} to receive the button events
Link to this section Summary
Functions
Returns a specification to start this module under a supervisor.
Return the current state of the button
Start a GenServer to watch the buttons on the Scroll HAT Mini
Link to this section Types
Specs
name() :: :a | :b | :x | :y
A name of Scroll HAT Mini button
These are labelled A, B, X, and Y on the board.
Link to this section Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
Specs
get_value(name()) :: 0 | 1
Return the current state of the button
0
- released
1
- pressed
Specs
start_link(keyword()) :: GenServer.on_start()
Start a GenServer to watch the buttons on the Scroll HAT Mini
Options:
:handler
- pass a pid or an MFA to receive button events