adafruit_ht16k33.ht16k33

  • Authors: Radomir Dopieralski & Tony DiCola for Adafruit Industries
class adafruit_ht16k33.ht16k33.HT16K33(i2c, address=112, auto_write=True, brightness=1.0)[source]

The base class for all displays. Contains common methods.

Parameters:
  • address (int) – The I2C addess of the HT16K33.
  • auto_write (bool) – True if the display should immediately change when set. If False, show must be called explicitly.
  • brightness (float) – 0.0 - 1.0 default brightness level.
auto_write

Auto write updates to the display.

The blink rate. Range 0-3.

brightness

The brightness. Range 0.0-1.0

fill(color)[source]

Fill the whole display with the given color.

show()[source]

Refresh the display and show the changes.

Matrix Displays

class adafruit_ht16k33.matrix.Matrix16x8(i2c, address=112, auto_write=True, brightness=1.0)[source]

The matrix wing.

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

Get or set the color of a given pixel.

class adafruit_ht16k33.matrix.Matrix8x8(i2c, address=112, auto_write=True, brightness=1.0)[source]

A single matrix.

columns

Read-only property for number of columns

image(img)[source]

Set buffer to value of Python Imaging Library image. The image should be in 1 bit mode and a size equal to the display size.

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

Get or set the color of a given pixel.

rows

Read-only property for number of rows

shift(x, y, rotate=False)[source]

Shift pixels by x and y

Parameters:rotate – (Optional) Rotate the shifted pixels to the left side (default=False)
shift_down(rotate=False)[source]

Shift all pixels down

Parameters:rotate – (Optional) Rotate the shifted pixels to top (default=False)
shift_left(rotate=False)[source]

Shift all pixels left

Parameters:rotate – (Optional) Rotate the shifted pixels to the right side (default=False)
shift_right(rotate=False)[source]

Shift all pixels right

Parameters:rotate – (Optional) Rotate the shifted pixels to the left side (default=False)
shift_up(rotate=False)[source]

Shift all pixels up

Parameters:rotate – (Optional) Rotate the shifted pixels to bottom (default=False)
class adafruit_ht16k33.matrix.Matrix8x8x2(i2c, address=112, auto_write=True, brightness=1.0)[source]

A bi-color matrix.

fill(color)[source]

Fill the whole display with the given color.

image(img)[source]

Set buffer to value of Python Imaging Library image. The image should be a size equal to the display size.

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

Get or set the color of a given pixel.

class adafruit_ht16k33.matrix.MatrixBackpack16x8(i2c, address=112, auto_write=True, brightness=1.0)[source]

A double matrix backpack.

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

Get or set the color of a given pixel.

Segment Displays

class adafruit_ht16k33.segments.BigSeg7x4(i2c, address=112, auto_write=True)[source]

Numeric 7-segment display. It has the same methods as the alphanumeric display, but only supports displaying a limited set of characters.

ampm

The AM/PM indicator.

bottom_left_dot

The bottom-left dot indicator.

top_left_dot

The top-left dot indicator.

class adafruit_ht16k33.segments.Colon(disp, num_of_colons=1)[source]

Helper class for controlling the colons. Not intended for direct use.

class adafruit_ht16k33.segments.Seg14x4(i2c, address=112, auto_write=True, brightness=1.0)[source]

Alpha-numeric, 14-segment display.

marquee(text, delay=0.25, loop=True)[source]

Automatically scroll the text at the specified delay between characters

Parameters:
  • text (str) – The text to display
  • delay (float) – (optional) The delay in seconds to pause before scrolling to the next character (default=0.25)
  • loop (bool) – (optional) Whether to endlessly loop the text (default=True)
print(value, decimal=0)[source]

Print the value to the display.

print_hex(value)[source]

Print the value as a hexidecimal string to the display.

scroll(count=1)[source]

Scroll the display by specified number of places.

set_digit_raw(index, bitmask)[source]

Set digit at position to raw bitmask value. Position should be a value of 0 to 3 with 0 being the left most character on the display.

bitmask should be 2 bytes such as: 0xFFFF If can be passed as an integer, list, or tuple

class adafruit_ht16k33.segments.Seg7x4(i2c, address=112, auto_write=True)[source]

Numeric 7-segment display. It has the same methods as the alphanumeric display, but only supports displaying a limited set of characters.

colon

Simplified colon accessor

scroll(count=1)[source]

Scroll the display by specified number of places.

set_digit_raw(index, bitmask)[source]

Set digit at position to raw bitmask value. Position should be a value of 0 to 3 with 0 being the left most digit on the display.