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 asyncio
from displaypad import DisplayPad
async def main():
# Create a new DisplayPad instance
pad = DisplayPad.DisplayPad()
# Define event handlers
@pad.on('down')
def on_key_down(key_index):
print(f"Key {key_index} has been pressed.")
# Define event handlers
@pad.on('up')
def on_key_down(key_index):
print(f"Key {key_index} has been released.")
# Define event handlers
@pad.on('error')
def on_error(error):
print(f"Error: {error}")
# Clear all keys
pad.clear_all_keys()
# Set the first three keys to red, green and blue
pad.set_key_color(0, 255, 0, 0)
pad.set_key_color(1, 0, 255, 0)
pad.set_key_color(2, 0, 0, 255)
# Keep the script running
while True:
await asyncio.sleep(1)
if __name__ == "__main__":
# Run the main function
asyncio.run(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.3.tar.gz
(4.6 kB
view details)
Built Distribution
File details
Details for the file displaypad-1.0.3.tar.gz
.
File metadata
- Download URL: displaypad-1.0.3.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 333211bb253bb33c32d9171ec859641c9b5ce883b6cdd07269680fa09993866f |
|
MD5 | 50c5aa64262f7b7dd0905a4563e3bcc9 |
|
BLAKE2b-256 | 42ac043372e545d08c74e899750af64cdc050c5fa87f7a26879c1035371de070 |
File details
Details for the file DisplayPad-1.0.3-py3-none-any.whl
.
File metadata
- Download URL: DisplayPad-1.0.3-py3-none-any.whl
- Upload date:
- Size: 4.9 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 | 75f65326a3468b70b0d455e8a9d1a964f6e1d747c76a615971442bb009ddce33 |
|
MD5 | 71200c8b7a22bd3ae2d459f32beafca4 |
|
BLAKE2b-256 | 06d2ec33a09b9649b042c0f0186c6c752f672cbbeeced517442dca571d9d4547 |