ltp305 (version 0.0.1)
index
/usr/local/lib/python3.11/dist-packages/ltp305/__init__.py

 
Package Contents
       
font

 
Classes
       
builtins.object
LTP305

 
class LTP305(builtins.object)
    LTP305(address=97, brightness=0.5)
 
_buf_matrix_left = [
# Row  7654321
    0b01111111,  # col 1, bottom = msb
    0b01111111,  # col 2
    0b01111111,  # col 3
    0b01111111,  # col 4
    0b01111111,  # col 5
    0b00000000,
    0b00000000,
    0b01000000   # bit 7 = decimal dot
]
 
_buf_matrix_right = [
# Col    12345
    0b00011111,  # row 1
    0b00011111,  # row 2
    0b00011111,  # row 3
    0b00011111,  # row 4
    0b00011111,  # row 5
    0b00011111,  # row 6
    0b10011111,  # row 7 + bit 8 = decimal dot
    0b00000000
]
 
  Methods defined here:
__init__(self, address=97, brightness=0.5)
LTP305 5x7 x 2 Matrix Driver
 
:param address: i2c address, one of 0x61, 0x62 or 0x63 (default 0x61)
:param brightness: LED brightness from 0.0 to 1.0 (default 0.5)
clear(self)
Clear both LED matrices.
 
Must call .show() to display changes.
get_shape(self)
Set the width/height of the display.
set_brightness(self, brightness, update=False)
Set brightness of both LED matrices.
 
:param brightnes: LED brightness from 0.0 to 1.0
:param update: Push change to display immediately (otherwise you must call .show())
set_character(self, x, char)
Set a single character.
 
:param x: x position, 0 for left, 5 for right, or in between if you fancy
:param char: string character or char ordinal
set_decimal(self, left=None, right=None)
Set decimal of left and/or right matrix.
 
:param left: State of left decimal dot
:param right: State of right decimal dot
set_image(self, image, offset_x=0, offset_y=0, wrap=False, bg=0)
Set a PIL image to the display buffer.
set_pixel(self, x, y, c)
Set a single pixel on the matrix.
 
:param x: x position from 0 to 9 (0-4 on left matrix, 5-9 on right)
:param y: y position
:param c: state on/off
show(self)
Update the LED matrixes from the buffer.

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
Data
        CMD_BRIGHTNESS = 25
CMD_MATRIX_L = 14
CMD_MATRIX_R = 1
CMD_MODE = 0
CMD_OPTIONS = 13
CMD_UPDATE = 12
MODE = 24
OPTS = 14
font = {32: [0, 0, 0, 0, 0], 33: [0, 0, 95, 0, 0], 34: [0, 7, 0, 7, 0], 35: [20, 127, 20, 127, 20], 36: [36, 42, 127, 42, 18], 37: [35, 19, 8, 100, 98], 38: [54, 73, 85, 34, 80], 39: [0, 5, 3, 0, 0], 40: [0, 28, 34, 65, 0], 41: [0, 65, 34, 28, 0], ...}