Crate led_bargraph

source ·
Expand description

Bargraph

A library for the Adafruit Bi-Color (Red/Green) 24-Bar Bargraph w/I2C Backpack Kit.

The HT16K33 has 16 rows by 8 commons for controlling 128 LEDs (#0-127). This is represented internally by an array of size 16 of type u8, where each lower bit of the u8 value denotes a common:

__ 0 2 4 8 16 32 64 128 00 0 1 2 3 4 5 6 7 01 8 9 10 11 12 13 14 15 … 14 112 113 114 115 116 117 118 119 15 120 121 122 123 124 125 126 127

The LED address (N) can be converted to a buffer location by modulo 8 to calculate the row, then left-shifted by the remainder to calculate the common:

LED #11 -> row 1, common 8 (e.g. 1 << 3)

Structs

Enums