elixir_max72xx v0.1.2 ElixirMax72xx.Matrix
Summary
Functions
Clear matrix
Will clear given row
Set decode-mode for matrix
Set intensity for matrix
Sets matrix values
Sets row lights
Set scanlimit for device
Shutdown matrix
Start the ElixirMax72xx GenServer to manage LED matrix
Get current state
Enable/disable matrix test feature
Types
Functions
Will clear given row
Rows could be integers from 1 to 8 Example:
iex> ElixirMax72xx.clear_row(1)
:ok
iex> ElixirMax72xx.clear_row(7)
:ok
iex> ElixirMax72xx.clear_row(0)
** (FunctionClauseError) no function clause matching in ElixirMax72xx.clear_row/1
Set decode-mode for matrix
Example:
iex> ElixirMax72xx.set_decodemod(0x0F)
:ok
Set intensity for matrix
Example:
iex> ElixirMax72xx.set_intensity(0x0F)
:ok
Sets matrix values
Example:
iex(1)> matrix_value = [
...(1)> 0b00000000,
...(1)> 0b00000000,
...(1)> 0b00000000,
...(1)> 0b00010000,
...(1)> 0b00000000,
...(1)> 0b00000000,
...(1)> 0b00000000,
...(1)> 0b00000000
...(1)> ]
[0, 0, 0, 0, 0, 0, 0, 0]
iex(2)> ElixirMax72xx.set_matrix(matrix_value)
:ok
Sets row lights
Parameters:
row
- row number 1..8value
- value of row lights0b00110011
Example:
iex> ElixirMax72xx.set_row(1, 0b00001100)
:ok
Set scanlimit for device
Example:
iex> ElixirMax72xx.set_scanlimit(7)
:ok
Shutdown matrix.
Example:
iex> ElixirMax72xx.shutdown(true)
:ok
iex> ElixirMax72xx.shutdown(false)
Start the ElixirMax72xx GenServer to manage LED matrix
Parameters:
devname
is the Linux device name for the bus (e.g., “spidev0.0”)opts
is a keyword list to configure the module
Get current state
Example
iex(1)> ElixirMax72xx.Matrix.state()
%ElixirMax72xx.Matrix.MatrixState{devname: "spidev0.0",
leds: [0, 0, 0, 0, 0, 0, 0, 0], pid: #PID<0.793.0>}