led-matrix (0.1.0)

Published 2024-10-07 15:18:16 +02:00 by remo

Installation

[registry]
default = "forgejo"

[registries.forgejo]
index = "sparse+" # Sparse index
# index = "" # Git

[net]
git-fetch-with-cli = true
cargo add led-matrix@0.1.0

About 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:

  1. install the Rust toolchain

  2. add the cross-compilation target: rustup target add thumbv6m-none-eabi

  3. needed to convert the firmware to a flashable format: cargo install elf2uf2-rs

  4. 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 tui to 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 trait LedMatrix, which defines the common capabilities of both hardware and GUI emulator. Located in crates/core.
  • led-matrix-bsp: Implements the LedMatrix trait on actual hardware. Located in crates/bsp.
  • led-matrix-gui: Implements the LedMatrix trait with a GUI emulator. Located in crates/gui.
  • led-matrix-tui: Implements the LedMatrix trait with a TUI emulator, as fallback if the GUI emulator doesn't work. Located in crates/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
Details
Cargo
2024-10-07 15:18:16 +02:00
22
44 KiB
Assets (1)
Versions (2) View all
0.1.1 2024-10-10
0.1.0 2024-10-07