Skip to content
Leas Porscha edited this page Aug 30, 2026 · 6 revisions

Welcome to the oss-mountain-displaypad wiki.

Packages

Package Install Use when
displaypad-lib pip install displaypad-lib Building scripts and apps (recommended)
displaypad-driver pip install displaypad-driver Direct USB access only

The driver is a dependency of the library — installing the library also installs the driver.

Getting Started

from displaypad_lib import DisplayPad, Key

class Hello(Key):
    def render(self, ctx):
        ctx.fill("black")
        ctx.center_text("Hello", color="white")

pad = DisplayPad()
pad[0] = Hello()

try:
    while True:
        pad.update()
except KeyboardInterrupt:
    pass
finally:
    pad.disable()

Wiki Pages

  • DisplayPad — DisplayPad constructor, methods, and hotplug usage.
  • Key — Key base class, lifecycle hooks, and built-in key types.
  • KeyContext — drawing API inside render().
  • Page — multi-page layouts and auto-timeout navigation.

Connection & Hotplugging

By default, DisplayPad() attempts to connect immediately upon instantiation, but fails safely without raising exceptions if the hardware is absent (is_connected() will return False).

Note: If you want DisplayPad() to raise an exception immediately if hardware is missing, pass auto_connect=False and call pad.driver.connect().

To handle device connect/disconnect and hotplugging dynamically at runtime:

import time
from displaypad_lib import DisplayPad
from displaypad_driver.hotplug import USBHotplugMonitor

pad = DisplayPad(auto_connect=False)
monitor = USBHotplugMonitor()
pad.try_connect()

try:
    while True:
        event = monitor.poll_event()

        if not pad.is_connected():
            if event == "add" or monitor.is_present():
                pad.try_connect()
            time.sleep(0.1)
            continue

        if event == "remove":
            pad.driver.close()
            continue

        pad.update(20)
except KeyboardInterrupt:
    pass
finally:
    pad.disable()

Clone this wiki locally