lcd_sdk
Classes:
| Name | Description |
|---|---|
LcdSdkManager |
Lcd SDK manager. |
LcdSdkManager
Lcd SDK manager.
Create Lcd SDK manager.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
A name of the LCD |
required |
|
LcdType
|
An integer representing the type of the LCD |
required |
Methods:
| Name | Description |
|---|---|
clear_display |
Clear display. |
logi_lcd_color_set_background |
Set an array of pixels as a rectangular area, 320 bytes wide and 240 bytes high. |
logi_lcd_color_set_text |
Set the specified text in the requested line on the color lcd device connected. |
logi_lcd_color_set_title |
Set the specified text in the first line on the color lcd device connected. |
logi_lcd_init |
Make the necessary initializations. |
logi_lcd_is_button_pressed |
Check if the button specified by the parameter is being pressed. |
logi_lcd_is_connected |
Check if a device of the type specified by the parameter is connected. |
logi_lcd_mono_set_background |
Set pixels as a rectangular area, 160 bytes wide and 43 bytes high. |
logi_lcd_mono_set_text |
Set the specified text in the requested line on the monochrome lcd device connected. |
logi_lcd_shutdown |
Kill the applet and frees memory used by the SDK. |
logi_lcd_update |
Update the LCD. |
update_display |
Update display LCD with image. |
update_text |
Update display LCD with a list of a text. |
Source code in src/dcspy/sdk/lcd_sdk.py
18 19 20 21 22 23 24 25 26 27 28 29 | |
clear_display
clear_display(true_clear: bool = False) -> None
Clear display.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
bool
|
|
False
|
Source code in src/dcspy/sdk/lcd_sdk.py
187 188 189 190 191 192 193 194 195 196 197 | |
logi_lcd_color_set_background
Set an array of pixels as a rectangular area, 320 bytes wide and 240 bytes high.
Since the color lcd can display the full RGB gamma, 32 bits per pixel (4-bytes) are used. The size of the colorBitmap array has to be 320x240x4 = 307,200 therefore. Note: In order to use this function, the image size must be 320x240
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
list[tuple[int, int, int, int]]
|
List of 320x240x4 pixels as integers |
required |
Returns:
| Type | Description |
|---|---|
bool
|
A result of execution |
Source code in src/dcspy/sdk/lcd_sdk.py
105 106 107 108 109 110 111 112 113 114 115 116 117 118 | |
logi_lcd_color_set_text
logi_lcd_color_set_text(
line_no: int,
text: str,
rgb: tuple[int, int, int] = (255, 255, 255),
) -> bool
Set the specified text in the requested line on the color lcd device connected.
If you don't specify any color, your title will be white.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
int
|
The color LCD has eight (8) lines for standard text |
required |
|
str
|
defines the text you want to display |
required |
|
tuple[int, int, int]
|
tuple with integer values between 0 and 255 (interpreted as red, green or blue) |
(255, 255, 255)
|
Returns:
| Type | Description |
|---|---|
bool
|
A result of execution |
Source code in src/dcspy/sdk/lcd_sdk.py
135 136 137 138 139 140 141 142 143 144 145 146 147 | |
logi_lcd_color_set_title
Set the specified text in the first line on the color lcd device connected.
The font size that will be displayed is bigger than the one used in the other lines, so you can use this function to set the title of your applet/page. If you don't specify any color, your title will be white.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
The text to display as a title |
required |
|
tuple[int, int, int]
|
a tuple with integer values between 0 and 255 as red, green, blue |
(255, 255, 255)
|
Returns:
| Type | Description |
|---|---|
bool
|
A result of execution |
Source code in src/dcspy/sdk/lcd_sdk.py
120 121 122 123 124 125 126 127 128 129 130 131 132 133 | |
logi_lcd_init
Make the necessary initializations.
You must call this function prior to any other function in the library.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
The name of your applet, you can't change it after initialization |
required |
|
LcdType
|
LCD type |
required |
Returns:
| Type | Description |
|---|---|
bool
|
A result of execution |
Source code in src/dcspy/sdk/lcd_sdk.py
31 32 33 34 35 36 37 38 39 40 41 42 | |
logi_lcd_is_button_pressed
Check if the button specified by the parameter is being pressed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
LcdButton
|
Defines the button to check on |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if a button is being pressed, False otherwise |
Source code in src/dcspy/sdk/lcd_sdk.py
55 56 57 58 59 60 61 62 63 64 | |
logi_lcd_is_connected
Check if a device of the type specified by the parameter is connected.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
LcdType
|
LCD type |
required |
Returns:
| Type | Description |
|---|---|
bool
|
A result of execution |
Source code in src/dcspy/sdk/lcd_sdk.py
44 45 46 47 48 49 50 51 52 53 | |
logi_lcd_mono_set_background
Set pixels as a rectangular area, 160 bytes wide and 43 bytes high.
Despite the display being monochrome, 8 bits per pixel are used here for simple manipulation of individual pixels.
Note: In order to use this function, the image size must be 160x43. The SDK will turn on the pixel on the screen if the value assigned to that byte is >= 128, it will remain off if the value is < 128.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
list[int]
|
List of 6880 (160x43) pixels as integer |
required |
Returns:
| Type | Description |
|---|---|
bool
|
A result of execution |
Source code in src/dcspy/sdk/lcd_sdk.py
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | |
logi_lcd_mono_set_text
Set the specified text in the requested line on the monochrome lcd device connected.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
int
|
The monochrome LCD has four (4) lines, so this parameter can be any number from zero (0) to three (3) |
required |
|
str
|
The text to display |
required |
Returns:
| Type | Description |
|---|---|
bool
|
A result of execution |
Source code in src/dcspy/sdk/lcd_sdk.py
93 94 95 96 97 98 99 100 101 102 103 | |
logi_lcd_shutdown
logi_lcd_shutdown() -> None
Kill the applet and frees memory used by the SDK.
Source code in src/dcspy/sdk/lcd_sdk.py
71 72 73 74 | |
logi_lcd_update
logi_lcd_update() -> None
Update the LCD.
Source code in src/dcspy/sdk/lcd_sdk.py
66 67 68 69 | |
update_display
update_display(image: Image) -> None
Update display LCD with image.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Image
|
Image object from the Pillow library |
required |
Source code in src/dcspy/sdk/lcd_sdk.py
172 173 174 175 176 177 178 179 180 181 182 183 184 185 | |
update_text
Update display LCD with a list of a text.
For mono, LCD it takes four (4) elements of the list and displays as four (4) rows. For color, LCD takes eight (8) elements of the list and displays as eight (8) rows.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
list[tuple[str, Color]]
|
List of strings to display, row by row |
required |
Source code in src/dcspy/sdk/lcd_sdk.py
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 | |