PCA9622Matrix8x8 (pca9622matrix8x8 v0.1.0)

Copy Markdown

Driver for the switch-science "I2C 8x8 LED matrix" board (https://www.switch-science.com/products/2071), which multiplexes an 8x8 LED matrix over I2C using the PCA9622 constant-current LED driver.

start_link/1 accepts:

  • :bus_name - the I2C bus to open (default: "i2c-2")
  • :i2c_address - the PCA9622's I2C address (default: 0x50)
  • :reflesh_interval - column refresh interval in ms (default: 10)
  • :initial_matrix - initial 8x8 matrix to display
  • :name - GenServer name to register under (default: PCA9622Matrix8x8); pass nil to start unnamed, which allows multiple boards to run at once. When a name other than the default is used (or nil), pass the returned pid/name explicitly to set_matrix/2, set_matrix_bit/4, set_interval/2 and stop/1.

Summary

Functions

all_off(ref, i2c_address \\ 80)

all_on(ref, i2c_address \\ 80)

bit_expand(x)

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

handle_continue(atom, arg)

Callback implementation for GenServer.handle_continue/2.

init(arg)

Callback implementation for GenServer.init/1.

init_led(bus_name \\ "i2c-2", i2c_address \\ 80)

read_led(ref, offset, i2c_address \\ 80)

set_00(ref, i2c_address \\ 80)

set_interval(server \\ __MODULE__, interval)

set_matrix(server \\ __MODULE__, mat)

set_matrix_all(value)

set_matrix_bit(server \\ __MODULE__, x, y, value)

set_xyzw(ref, x, y, z, w, i2c_address \\ 80)

start_link(opts \\ [])

stop(server \\ __MODULE__)

stop_led(ref, i2c_address \\ 80)

test_loop(ref, i2c_address \\ 80)

test_start(bus_name \\ "i2c-2", i2c_address \\ 80)