PCA9622Matrix8x8 (pca9622matrix8x8 v0.1.2)

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)

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

set_interval(server \\ __MODULE__, interval)

set_matrix(server \\ __MODULE__, mat)

set_matrix_all(value)

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

start_link(opts \\ [])

stop(server \\ __MODULE__)