Skip to main content

Framework Laptop 16 - Input Module Software

This repository contains a python library and scripts to control the (non-keyboard) input modules, which is currently just the LED Matrix.

Installing

Pre-requisites: Python with pip

python3 -m pip install framework16_inputmodule

Control from the host

To build your own application see the: API command documentation

Permissions on Linux

To ensure that the input module's port is accessible, install the udev rule and trigger a reload:

sudo cp release/50-framework-inputmodule.rules /etc/udev/rules.d/
sudo udevadm control --reload && sudo udevadm trigger
Common commands:
Listing available devices
> ledmatrixctl
More than 1 compatible device found. Please choose with --serial-dev ...
Example on Windows: --serial-dev COM3
Example on Linux:   --serial-dev /dev/ttyACM0
/dev/ttyACM1
  VID:     0x32AC
  PID:     0x0020
  SN:      FRAKDEBZ0100000000
  Product: LED Matrix Input Module
/dev/ttyACM0
  VID:     0x32AC
  PID:     0x0020
  SN:      FRAKDEBZ0100000000
  Product: LED Matrix Input Module
Apply command to single device

When there are multiple devices you need to select which one to control.

# Example on Linux
> ledmatrixctl --serial-dev /dev/ttyACM0 --percentage 33

# Example on Windows
> ledmatrixctl --serial-dev COM5 --percentage 33

Graphical Application

Launch the graphical application

# Either via the commandline
ledmatrixctl --gui

# Or using the standanlone application
ledmatrixgui

Other example commands

# Show current time and keep updating it
ledmatrixctl --clock

# Draw PNG or GIF
ledmatrixctl --image stripe.gif
ledmatrixctl --image stripe.png

# Change brightness (0-255)
ledmatrixctl --brightness 50

All commandline options

> ledmatrixctl --help
options:
  -h, --help            show this help message and exit
  -l, --list            List all compatible devices
  --bootloader          Jump to the bootloader to flash new firmware
  --sleep, --no-sleep   Simulate the host going to sleep or waking up
  --is-sleeping         Check current sleep state
  --brightness BRIGHTNESS
                        Adjust the brightness. Value 0-255
  --get-brightness      Get current brightness
  --animate, --no-animate
                        Start/stop vertical scrolling
  --get-animate         Check if currently animating
  --pwm {29000,3600,1800,900}
                        Adjust the PWM frequency. Value 0-255
  --get-pwm             Get current PWM Frequency
  --pattern {...}       Display a pattern
  --image IMAGE         Display a PNG or GIF image in black and white only)
  --image-grey IMAGE_GREY
                        Display a PNG or GIF image in greyscale
  --camera              Stream from the webcam
  --video VIDEO         Play a video
  --percentage PERCENTAGE
                        Fill a percentage of the screen
  --clock               Display the current time
  --string STRING       Display a string or number, like FPS
  --symbols SYMBOLS [SYMBOLS ...]
                        Show symbols (degF, degC, :), snow, cloud, ...)
  --gui                 Launch the graphical version of the program
  --panic               Crash the firmware (TESTING ONLY)
  --blink               Blink the current pattern
  --breathing           Breathing of the current pattern
  --eq EQ [EQ ...]      Equalizer
  --random-eq           Random Equalizer
  --wpm                 WPM Demo
  --snake               Snake
  --snake-embedded      Snake on the module
  --pong-embedded       Pong on the module
  --game-of-life-embedded {currentmatrix,pattern1,blinker,toad,beacon,glider}
                        Game of Life
  --quit-embedded-game  Quit the current game
  --all-brightnesses    Show every pixel in a different brightness
  -v, --version         Get device version
  --serial-dev SERIAL_DEV
                        Change the serial dev. Probably /dev/ttyACM0 on Linux, COM0 on Windows

Update the Firmware

First, put the module into bootloader mode.

This can be done either by flipping DIP switch #2 or by using one of the following commands:

> ledmatrixctl --bootloader

Then the module will present itself in the same way as a USB thumb drive. Copy the UF2 firmware file onto it and the device will flash and reset automatically.


### Check the firmware version of the device

```sh
> ledmatrixctl --version
Device Version: 0.1.7
By looking at the USB descriptor

On Linux:

> lsusb -d 32ac: -v 2> /dev/null | grep -P 'ID 32ac|bcdDevice'
Bus 003 Device 078: ID 32ac:0020 Framework Computer Inc LED Matrix Input Module
  bcdDevice            0.17

Metadata

Release files for framework16-inputmodule 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for framework16-inputmodule 0.1.1
File Size Uploaded
framework16_inputmodule-0.1.1.tar.gz 17.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for framework16-inputmodule 0.1.1
File Interpreter ABI Platform
framework16_inputmodule-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 38.2 kB

Release files / framework16_inputmodule-0.1.1.tar.gz

Download URL framework16_inputmodule-0.1.1.tar.gz
Size 17.2 kB
Tags Source
SHA-256 checksum
How to use checksums
a43bfc98819966dc4ee5e371e44e91bc61db204dddaf5cdf517fb9716a8816b4
BLAKE2b-256 checksum
How to use checksums
88d8b97e5debd0e7f7a4dd6f8aa58a355f6eb5c9e079573638c8072b0f53f944
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.12.0

Release files / framework16_inputmodule-0.1.1-py3-none-any.whl

Download URL framework16_inputmodule-0.1.1-py3-none-any.whl
Size 21.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9ca49e8cfcf31ae786d21ee6a446e5ff9bbbb198351a72fccb6ef658cd5bd60b
BLAKE2b-256 checksum
How to use checksums
61e9a9d6661a74b8f37d8d08a64b18f6c751833274e6c5ddad277224e3635d69
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.12.0

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page