Crate maxmatrix_rs

Source
Expand description

This Library enables communication between a Microcontroller and the MAX7219 LED Matrix Driver.

§Example:

#![no_std]
#![no_main]
 
use panic_halt as _;
 
use maxmatrix_rs::*;
 
#[arduino_hal::entry]
fn main() -> ! {
    let dp = arduino_hal::Peripherals::take().unwrap();
    let pins = arduino_hal::pins!(dp);
    
    let din = pins.d3.into_output();
    let cs = pins.d5.into_output();
    let clk = pins.d6.into_output();

    let mut matrix = MaxMatrix::new(din, cs, clk, 4);
    matrix.init();

    loop {
        matrix.set_dot(0, 0, true);
        arduino_hal::delay_ms(500);
        matrix.set_dot(0, 0, false);
        arduino_hal::delay_ms(500);
    }
}

Structs§

MaxMatrix
The Struct to communicate with the MAX7219 LED Matrix