Skip to content

radimklaska/framework_led_matrix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Framework LED Matrix Bar Graphs

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.

Requirements

  • Framework Laptop 16 with two LED Matrix input modules
  • Python 3
  • pyserial
pip install pyserial

Usage

# 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.txt

Input File Format

Plain 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".

Cron Example

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 )

Device Mapping

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.

Troubleshooting

"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 $USER

Log out and back in for the change to take effect.

Related Resources

  • 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)

About

Use LED Matrix on Framework Laptop 16 to display 19 bar graph and top row as 19 on/off statuses.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages