Display vertical bar graphs on Framework Laptop 16 LED Matrix input modules.
Reads 18 percentage values (0-100) from a file and displays them as bars across two LED matrix modules (9 columns each). Bars grow from the bottom up, using 32 LEDs per column. The top row can be independently controlled via optional "on"/"off" lines.
- Framework Laptop 16 with two LED Matrix input modules
- Python 3
- pyserial
pip install pyserial# Basic usage
python3 led_bars.py /path/to/values.txt
# Custom brightness (0-255, default: 255)
python3 led_bars.py -b 128 /path/to/values.txt
# Swap device assignment
python3 led_bars.py --swap-devices /path/to/values.txt
# Custom device paths
python3 led_bars.py --device0 /dev/ttyACM2 --device1 /dev/ttyACM3 /path/to/values.txtPlain text file with 18 percentage values (0-100), optionally followed by 18 "on"/"off" lines for top LED control:
100
90
80
70
60
50
40
30
20
10
20
30
40
50
60
70
80
90
on
off
on
off
on
off
on
off
on
off
on
off
on
off
on
off
on
off
The top LED lines are optional. Missing or invalid lines default to "off".
Update LEDs every 30 seconds:
* * * * * /path/to/led_bars.py --brightness 50 /path/to/values.txt
* * * * * ( sleep 30 ; /path/to/led_bars.py --brightness 50 /path/to/values.txt )By default:
- Values 1-9 display on
/dev/ttyACM1(left module) - Values 10-18 display on
/dev/ttyACM0(right module)
Use --swap-devices to reverse this mapping.
"Device or resource busy": Another application (e.g., browser tab with LED matrix control) is using the serial port. Close it and try again.
Permission denied: Add your user to the dialout group:
sudo usermod -aG dialout $USERLog out and back in for the change to take effect.
- LED Matrix Module - Official Framework product page
- LED Matrix Web Tool - Browser-based tool for creating and displaying patterns
- inputmodule-rs - Official Rust firmware and control software for Framework input modules (LED Matrix, B1 Display, C1 Minimal)