Module blocking

Source
Expand description

Blocking support for the 5x5 LED display.

This module provides a simple blocking interface to the on board 5x5 LED display. If you need a more sophisticated or non-blocking interface use the display::nonblocking module.

§Example

// take the board
let board = Board::take().unwrap();
// make a timer
let mut timer = hal::Timer::new(board.TIMER0);
// create the Display
let mut display = Display::new(board.display_pins);
// and light up some LEDs
let heart = [
    [0, 1, 0, 1, 0],
    [1, 0, 1, 0, 1],
    [1, 0, 0, 0, 1],
    [0, 1, 0, 1, 0],
    [0, 0, 1, 0, 0],
];
loop {
    display.show(&mut timer, heart, 1000);
    display.clear();
    timer.delay_ms(250);
}

The coordiante system is oriented so the ‘bottom’ (x,4) row is the edge with the edge connector. That means that

display.show(
   &mut timer,
   [
       [0, 0, 1, 0, 0],
       [0, 1, 1, 1, 0],
       [1, 0, 1, 0, 1],
       [0, 0, 1, 0, 0],
       [0, 0, 1, 0, 0],
   ],
   1000,
);

Will display an arrow pointing towards the boards usb port.

For a working example examples/display-blocking

Structs§

Display
Blocking interface to the on board LED display