led-matrix (0.1.0)
Installation
[registry]
default = "forgejo"
[registries.forgejo]
index = "sparse+ " # Sparse index
# index = " " # Git
[net]
git-fetch-with-cli = truecargo add led-matrix@0.1.0About 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
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 |
|---|---|
| led-matrix-core | ^0.1.0 |
| led-matrix-gui | ^0.1.0 |
| led-matrix-tui | ^0.1.0 |
| cortex-m-rt | ^0.7.3 |
| led-matrix-bsp | ^0.1.0 |
| panic-halt | ^0.2.0 |
| rp-pico | ^0.9.0 |