rpi-led-matrix

Crates.iorpi-led-matrix
lib.rsrpi-led-matrix
version0.4.0
sourcesrc
created_at2018-02-12 16:28:29.744245
updated_at2022-01-05 16:44:34.737249
descriptionBindings for Hzeller's RPi-RGB-Led-Matrix
homepagehttps://docs.rs/rpi-led-matrix/
repositoryhttps://github.com/rust-rpi-led-matrix/rust-rpi-rgb-led-matrix
max_upload_size
id50882
size95,923
Tyler Holmes (TDHolmes)

documentation

README

rpi-led-matrix

Safe rust bindings on top of the C++ library rpi-rgb-led-matrix.

Usage

The examples have more detailed usage, but here is basic usage to get things rendering on your display.

use rpi_led_matrix::{LedMatrix, LedColor};

let matrix = LedMatrix::new(None, None).unwrap();
let mut canvas = matrix.offscreen_canvas();
for red in 0..255 {
    for green in 0..255 {
        for blue in 0..255 {
            canvas.fill(&LedColor { red, green, blue });
            canvas = matrix.swap(canvas);
        }
    }
}

Note that if you have wirings other than the libraries "default", you will need to construct arguments to the library to specify the layout. See LedMatrixOptions for more information.

Documentation

Commit count: 94

cargo fmt