This library allows you to customize your own Mountain DisplayPad by assigning each button its own custom function, image or color.
Project description
DisplayPad
This library allows you to customize your own Mountain DisplayPad by assigning each button its own custom function, image or color.
Example
import time
from displaypad import DisplayPad
def main():
pad = DisplayPad.DisplayPad()
@pad.on('down')
def on_key_down(key_index):
print(f"Key {key_index} has been pressed.")
@pad.on('up')
def on_key_down(key_index):
print(f"Key {key_index} has been released.")
@pad.on('error')
def on_error(error):
print(f"Error: {error}")
pad.clear_all_keys()
pad.set_key_color(0, 255, 0, 0)
pad.set_key_color(1, 0, 255, 0)
pad.set_key_color(2, 0, 0, 255)
image = bytearray(pad.ICON_SIZE * pad.ICON_SIZE * 3)
for i in range(pad.ICON_SIZE * pad.ICON_SIZE):
image[i * 3] = 0xff
image[i * 3 + 1] = 0x00
image[i * 3 + 2] = 0x00
while True:
time.sleep(1)
if __name__ == "__main__":
main()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
displaypad-1.0.2.tar.gz
(4.5 kB
view details)
Built Distribution
File details
Details for the file displaypad-1.0.2.tar.gz
.
File metadata
- Download URL: displaypad-1.0.2.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 074837060f2d2705be8fc490079e86a453cc8d43e35d404471c261fb78fe2540 |
|
MD5 | 68642da59f0c8d312c6762686354432c |
|
BLAKE2b-256 | a767fc10feb09a1fc21532f73b6fa10e69dcf88a9b098fb66043fa054b65dd52 |
File details
Details for the file DisplayPad-1.0.2-py3-none-any.whl
.
File metadata
- Download URL: DisplayPad-1.0.2-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a97ea49843be5ea7739fd19bc2e998cb076766d59e602189dfb45ca8361988f8 |
|
MD5 | 4ec00c284c83656b438a5d902dd9fc7d |
|
BLAKE2b-256 | d538a45fceaf5cbe85635fadbcacc1e25f555a502058f0066fe9d6e2a6bf11e6 |