Skip to main content

A simple library to for the Mountain DisplayPad

Project description

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('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


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.1.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

DisplayPad-1.0.1-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file displaypad-1.0.1.tar.gz.

File metadata

  • Download URL: displaypad-1.0.1.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for displaypad-1.0.1.tar.gz
Algorithm Hash digest
SHA256 ce6e771fb1ddbb04ffa90f997d0b5257e605faf6b28ef6efa6669adfa74a0805
MD5 d5871872ed5715129637a530d150d958
BLAKE2b-256 8c3f3d6028a5182f01079b16d1135134ab4c5e474d94194aa183a283d550b076

See more details on using hashes here.

File details

Details for the file DisplayPad-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: DisplayPad-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for DisplayPad-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 87a8649c8018398831f170ed586d0cc32724be139da9ad5feae951ca73650b67
MD5 693ae8dfc74b7a136edd7a2c0a1e3037
BLAKE2b-256 e7918646377c928dc0315934c52a3093c1c022f29f8099958a7862b1625b4765

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page