Ht16k33Multi.Font (ht16k33_multi v0.2.0)

View Source

Font for the Ht16k33 7-segment display. This module converts characters into segment data for the display.

Command Structure for the 7-Segment Display

One position on the 7-segment display:

        1
       ___
  (2) |   | 2
  (4)  ---
  (1) |   | 4
       ---  * (8)
        8

Where:

  • (x) represents the first hex value
  • x represents the last hex value

Examples:

  • For the character "0", the segments (2), (1) (= 3) and segments 1, 2, 4, 8 (= 15 = hex F) are lit. This corresponds to the hex value 0x3F.
  • For the character "4", the segments (2), (4) (= 6) and segments 2, 4 (= 6) are lit. This corresponds to the hex value 0x66.

Segment Hex Mappings:

SEGMENTS_ON
HEX8 4 2 1
-------------------
00 0 0 0
10 0 0 1
20 0 1 0
30 0 1 1
40 1 0 0
50 1 0 1
60 1 1 0
70 1 1 1
81 0 0 0
91 0 0 1
A1 0 1 0
B1 0 1 1
C1 1 0 0
D1 1 0 1
E1 1 1 0
F1 1 1 1

Summary

Functions

Converts characters or integers to their corresponding hexadecimal values for displaying the correct segments on a 7-segment display. For example, the letter "A" is displayed with the command 0x77.

Functions

segments(characters)

(since 0.1.0)
@spec segments(String.t() | integer()) :: [integer()]

Converts characters or integers to their corresponding hexadecimal values for displaying the correct segments on a 7-segment display. For example, the letter "A" is displayed with the command 0x77.

This function returns the hexadecimal segment commands for a string of characters or an integer to be displayed on the 7-segment display.