HT16K33 v0.1.0 HT16K33.SevenSegmentBig View Source

Module to controll the ‘big’ 1.2” Adafruit Seven Segment display with HT16K33 Backpack.

Link to this section Summary

Functions

Starts the needed Main-Module HT16K33 GenServer, clears all LEDs and returs a state including the pid, which will be used in other functions of this Sub-Module

Turns the colon(s) or dot on/off

Sets a predefined digit at the given position

Used to write a non-predefined data to the needed register

Start and link the SevenSegmentBig GenServer

Link to this section Functions

Link to this function init(list) View Source
init(list()) :: {:ok, %{pid: pid()}}

Starts the needed Main-Module HT16K33 GenServer, clears all LEDs and returs a state including the pid, which will be used in other functions of this Sub-Module.

Link to this function set_colon(pos, status) View Source
set_colon(0..2, atom()) :: {:ok}

Turns the colon(s) or dot on/off.

pos is the position of the colon/dot from 0 on the left to 2 on the right. status can be either :on or :off.

Link to this function set_digit(digit, pos) View Source
set_digit(String.t(), 0..3) :: {:ok}

Sets a predefined digit at the given position.

digit can be one of the following values provided as string: -, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F, L or a ‘space’-character like “ “ to clear the position.

pos starts at 0 from left to right till 3.

Link to this function set_raw(register, data) View Source
set_raw(byte(), byte()) :: {:ok}

Used to write a non-predefined data to the needed register.

Link to this function start_link(i2c_devname \\ "i2c-1", i2c_address \\ 112) View Source
start_link(String.t(), byte()) :: {:ok, pid()}

Start and link the SevenSegmentBig GenServer.

i2c_devname and i2c_address can be defined. Else the default settings will be used.

For more informatins about devname and the adress, take a look at the used module ElixirALE.I2C and it’s documentation: https://hexdocs.pm/elixir_ale/ElixirALE.I2C.html