DISPLAY_HT16K33

display_ht16k33.ht16k33

On Display Simulation for an HT16K33 driver. Works with 16x8 and 8x8 matrices.

Based on some code from https://github.com/adafruit/Adafruit_CircuitPython_HT16K33.git Authors: Radomir Dopieralski and Tony DiCola License: MIT

  • Author(s): Jose D. Montoya

class display_ht16k33.ht16k33.HT16K33(x, y, radius=10, text=False, num_led_x: int = 16, num_led_y: int = 8, register_width: int = 2)[source]

Main class :param int x: x coordinates in pixels for the matrix to start. This is the top left corner of the first digit :param int y: y coordinates in pixels for the matrix to start. This is the top left corner of the first digit

Parameters:
radius : int

led radius in pixels. Defaults to 10 pixels

text : bool

define if the matrix will be used to display text. For reasons that are beyond my understanding :). The text and pixels examples work differently. displaying text will use framebuffer, and it will show in a different direction. will be good to review a PR if you found this situation a little too much for your OCD ;)

num_led_x : int

Led quantity in the x direction. Although you could select a different value than 8 or 16, library logic is tested with these value, so unexpected behaviour is expected, if these values are not used

num_led_y : int

Led quantity in the y direction. Although you could select a different value than 8, library logic is tested with this value, so unexpected behaviour is expected, if this value is not used

:param register_width int:register width to be used. Defaults to 2

convert_to_leds(y) None[source]

Internal function to convert values to a led on and off matrix :param int y: y row number :return: None

fill(color: bool) None[source]

fill the entire matrix

pixel(x: int, y: int, color=True) None[source]

Set a specific pixel in the matrix :param int x: pixel’s x coordinate in the matrix :param int y: pixel’s y coordinate in the matrix :param bool color: if the pixel is to be shown or not. Defaults to shown True

set(y: int, new_value: int) None[source]

Set a particular value in a specific row defined by y

Parameters:
y : int

row number

new_value : int

value to be set

shift(x: int, y: int, rotate: bool = True) None[source]

Shift Matrix by x and y

Parameters:
x : int

pixel x coordinate

y : int

pixel x coordinate

shift_down(rotate: bool = False) None[source]

Shift all pixels down

Parameters:
rotate: bool = False

(Optional) Rotate the shifted pixels to top (default=False)

shift_left(rotate: bool = False) None[source]

Shift all pixels left

Parameters:
rotate: bool = False

(Optional) Rotate the shifted pixels to the right side (default=False)

shift_right(rotate: bool = False) None[source]

Shift all pixels right

Parameters:
rotate: bool = False

(Optional) Rotate the shifted pixels to the left side (default=False)

shift_up(rotate: bool = False) None[source]

Shift all pixels up

Parameters:
rotate: bool = False

(Optional) Rotate the shifted pixels to bottom (default=False)

update(y: int) None[source]

Update a particular Row

Parameters:
y : int

row y number

update_all() None[source]

Update all the matrix

property value : bytearray

Value of the buffer

display_ht16k33.matrix

On Display Simulation for an HT16K33 driver. Works with 16x8 and 8x8 matrices.

Based on some code from https://github.com/adafruit/Adafruit_CircuitPython_HT16K33.git Authors: Radomir Dopieralski and Tony DiCola License: MIT

  • Author(s): Jose D. Montoya

class display_ht16k33.matrix.Matrix16x8(x, y, radius, text)[source]

A single matrix. :param int x: x coordinates in pixels for the matrix to start. This is the top left corner of the first digit :param int y: y coordinates in pixels for the matrix to start. This is the top left corner of the first digit :param int radius: led radius in pixels.

Parameters:
text : bool

define if the matrix will be used to display text. For reasons that are beyond my understanding :). The text and pixels examples work differently. displaying text will use framebuffer, and it will show in a different direction. will be good to review a PR if you found this situation a little too much for your OCD ;)

class display_ht16k33.matrix.Matrix8x8(x, y, radius, text)[source]

A single matrix. :param int x: x coordinates in pixels for the matrix to start. This is the top left corner of the first digit :param int y: y coordinates in pixels for the matrix to start. This is the top left corner of the first digit

Parameters:
radius : int

led radius in pixels.

text : bool

define if the matrix will be used to display text. For reasons that are beyond my understanding :). The text and pixels examples work differently. displaying text will use framebuffer, and it will show in a different direction. will be good to review a PR if you found this situation a little too much for your OCD ;)

display_ht16k33.segments

On Display Simulation for an HT16K33 driver. Works with 7x4 Segments.

Based on some code from https://github.com/adafruit/Adafruit_CircuitPython_HT16K33.git Authors: Radomir Dopieralski and Tony DiCola License: MIT

  • Author(s): Jose D. Montoya

class display_ht16k33.segments.SEG14x4(x: int, y: int, height: int = 40, length: int = 40, space: int = 70, stroke: int = 4, color_off: int = 0x123456, color_on: int = 0xFF5500, char_dict: dict[str, int] | None = None)[source]

Main class to display the 14x4 segments on the screen

Parameters:
x : int

x coordinates in pixels for the segment to start. This is the top left corner of the first digit

y : int

y coordinates in pixels for the segment to start. This is the top left corner of the first digit

height : int

segment height in pixels. Defaults to 40 pixels

length : int

segment length in pixels. Defaults to 40 pixels

stroke : int

segment width in pixels. Defaults to 4 pixels

color_off : int|tuple

(RGB tuple or 24-bit hex value) segment fill color when segment is on. Defaults to 0x123456 Blue.

color_on : int|tuple

(RGB tuple or 24-bit hex value) segment fill color when segment is on. Defaults to 0xFF5500 orange.

char_dict : dict

An optional dictionary mapping strings to bit settings integers used for defining how to display custom letters

clear()[source]

Clear the digits

marquee(text: str, delay: float = 0.25, loop: bool = True) None[source]

Automatically scroll the text at the specified delay between characters

Parameters:
text : str

Text to display

delay : float

Delay in seconds to pause before scrolling to the next character. Defaults to 0.25 seconds

loop : bool

Whether to endlessly loop the text. Defaults to True

non_blocking_marquee(text: str, delay: float = 0.25, loop: bool = True) None[source]

Non Blocking Marquee Definition function

Parameters:
text : str

Text to display

delay : float

Delay in seconds to pause before scrolling to the next character. Defaults to 0.25 seconds

loop : bool

Whether to endlessly loop the text. Defaults to True

non_blocking_marquee_update()[source]

Non Blocking Marquee update function

print(value)[source]

Print the value given. Only work with strings

Parameters:
value : str

String to be put in the 7x4 segment

print_digit(pos, char)[source]

Print a specific digit

scroll(count: int = 1) None[source]

Scroll the display by specified number of places.

Parameters:
count : int

The number of places to scroll

class display_ht16k33.segments.SEG7x4(x: int, y: int, height: int = 40, length: int = 40, space: int = 70, stroke: int = 4, color_off: int | tuple = 0x123456, color_on: int | tuple = 0xFF5500, char_dict: dict[str, int] | None = None)[source]

Main class to display the 7x4 segments on the screen

Parameters:
x : int

x coordinates in pixels for the segment to start. This is the top left corner of the first digit

y : int

y coordinates in pixels for the segment to start. This is the top left corner of the first digit

height : int

segment height in pixels. Defaults to 40 pixels

length : int

segment length in pixels. Defaults to 40 pixels

stroke : int

segment width in pixels. Defaults to 4 pixels

color_off : int|tuple

(RGB tuple or 24-bit hex value) segment fill color when segment is on. Defaults to 0x123456 Blue.

color_on : int|tuple

(RGB tuple or 24-bit hex value) segment fill color when segment is on. Defaults to 0xFF5500 orange.

char_dict : dict

An optional dictionary mapping strings to bit settings integers used for defining how to display custom letters

clear() None[source]

Clear the digits

property colon

Colon property

fill(value: int) None[source]

Fill function. to be compatible with the Hardware version of the library

marquee(text: str, delay: float = 0.25, loop: bool = True) None[source]

Automatically scroll the text at the specified delay between characters

Parameters:
text : str

Text to display

delay : float

Delay in seconds to pause before scrolling to the next character. Defaults to 0.25 seconds

loop : bool

Whether to endlessly loop the text. Defaults to True

property points

points property

print(value: int | str) None[source]

Print the value given. Only work with strings

Parameters:
value : int|str

String to be put in the 7x4 segment

print_digit(pos: int, char: str) None[source]

Print a specific digit

Parameters:
pos : int

position in the 7x4 segment

char : str

character to be printed

set_digit_raw(pos, value)[source]

Set digit raw