led-matrix-gui (0.1.1)
Installation
[registry]
default = "forgejo"
[registries.forgejo]
index = "sparse+ " # Sparse index
# index = " " # Git
[net]
git-fetch-with-cli = truecargo add led-matrix-gui@0.1.1About this package
led-matrix-rs
ZHAW LED-Matrix-Workshop spin-off using Rust instead of Python.
It provides a GUI emulator for local debugging.
The documentation is hosted here.
Usage
There is a template repository here, which gives you all the necessary boilerplate to use this library in your own application. Please read the setup steps in the readme carefully.
You can find examples to run in the directory examples.
Setup:
-
add the cross-compilation target:
rustup target add thumbv6m-none-eabi -
needed to convert the firmware to a flashable format:
cargo install elf2uf2-rs -
If you are on linux, you need a couple dependencies from your package manager to run the GUI emulator. Refer to the documentation here, it should only be a single command.
If you can't get the GUI emulator working for some reason, there is also a simpler TUI emulator. You can use it by adding
--features tuito any command you use for running examples. However, be aware that the TUI emulator has a worse user experience. The terminal cannot detect key release events, so you must press e separate button to indicate when the joystick was released.
To run the emulator:
cargo run --example $EXAMPLE
To run on hardware, first connect the LED-matrix while keeping BOOTSEL pressed, then:
cargo run --release --target thumbv6m-none-eabi --example $EXAMPLE
Contributing
There is a justfile for common development tasks.
For example, run just check to make sure everything compiles. (different targets, features and documentation)
The project is split into four crates:
led-matrix: The main library users interact with. Located in the root directory of this repository.led-matrix-core: Defines a traitLedMatrix, which defines the common capabilities of both hardware and GUI emulator. Located incrates/core.led-matrix-bsp: Implements theLedMatrixtrait on actual hardware. Located incrates/bsp.led-matrix-gui: Implements theLedMatrixtrait with a GUI emulator. Located incrates/gui.led-matrix-tui: Implements theLedMatrixtrait with a TUI emulator, as fallback if the GUI emulator doesn't work. Located incrates/tui.
Much of the hardware code is based on the pico_ws2812_led example of rp-pico.
Dependencies
| ID | Version |
|---|---|
| eframe | ^0.29.1 |
| led-matrix-core | ^0.1.1 |
| serde | ^1.0.210 |
| serde_json | ^1.0.128 |