fn show_inner<D: DelayUs<u32>>(
        &mut self,
        delay: &mut D,
        led_matrix: [[u8; NUM_COLS]; NUM_ROWS],
        duration_ms: u32,
    ) {
        // TODO: something more intelligent with timers
        let loops = duration_ms / (self.rows.len() as u32 * self.delay_ms);
        for _ in 0..loops {
            for (row_line, led_matrix_row) in self.rows.iter_mut().zip(led_matrix.iter()) {
                row_line.set_high().ok();
                for (col_line, led_matrix_val) in self.cols.iter_mut().zip(led_matrix_row.iter()) {
                    // TODO : use value to set brightness
                    if *led_matrix_val > 0 {
                        col_line.set_low().ok();
                    }
                }
                delay.delay_us(self.delay_ms * 1000);
                for col_line in &mut self.cols {
                    col_line.set_high().ok();
                }
                row_line.set_low().ok();
            }
        }
    }
/// Display matrix image for a given duration (3x9 for V1 micro:bit)
///
/// The pins are represented as a [3x9 matrix on the micro:bit
/// V1](https://tech.microbit.org/hardware/1-5-revision/#display).
Display matrix image for a given duration (3x9 for V1 micro:bit)
The pins are represented as a [3x9 matrix on the micro:bit
V1].
Display matrix image for a given duration ( 3x9 for V1 micro : bit ) The pins are represented as a [ 3x9 matrix on the micro : bit V1 ] .
fn show_inner<D: DelayUs<u32>>(
        &mut self,
        delay: &mut D,
        led_matrix: [[u8; NUM_COLS]; NUM_ROWS],
        duration_ms: u32,
    ) {
        // TODO: something more intelligent with timers
        let loops = duration_ms / (self.rows.len() as u32 * self.delay_ms);
        for _ in 0..loops {
            for (row_line, led_matrix_row) in self.rows.iter_mut().zip(led_matrix.iter()) {
                row_line.set_high().ok();
                for (col_line, led_matrix_val) in self.cols.iter_mut().zip(led_matrix_row.iter()) {
                    // TODO : use value to set brightness
                    if *led_matrix_val > 0 {
                        col_line.set_low().ok();
                    }
                }
                delay.delay_us(self.delay_ms * 1000);
                for col_line in &mut self.cols {
                    col_line.set_high().ok();
                }
                row_line.set_low().ok();
            }
        }
    }
fn show_inner < D : DelayUs < u32 > > ( & mut self , delay : & mut D , led_matrix : [ [ u8 ; NUM_COLS ] ; NUM_ROWS ] , duration_ms : u32 , ) { // TODO: something more intelligent with timers let loops = duration_ms / ( self . rows . len ( ) as u32 * self . delay_ms ) ; for _ in 0 .. loops { for ( row_line , led_matrix_row ) in self . rows . iter_mut ( ) . zip ( led_matrix . iter ( ) ) { row_line . set_high ( ) . ok ( ) ; for ( col_line , led_matrix_val ) in self . cols . iter_mut ( ) . zip ( led_matrix_row . iter ( ) ) { // TODO : use value to set brightness if * led_matrix_val > 0 { col_line . set_low ( ) . ok ( ) ; } } delay . delay_us ( self . delay_ms * 1000 ) ; for col_line in & mut self . cols { col_line . set_high ( ) . ok ( ) ; } row_line . set_low ( ) . ok ( ) ; } } }
Display matrix image for a given duration (3x9 for V1 micro:bit)
The pins are represented as a [3x9 matrix on the micro:bit
V1](https://tech.microbit.org/hardware/1-5-revision/#display).
Display matrix image for a given duration ( 3x9 for V1 micro : bit ) The pins are represented as a [ 3x9 matrix on the micro : bit V1 ] ( https : // tech . microbit . org / hardware / 1 - 5 - revision / #display ) .
&mut self
delay
&mut D
led_matrix
[[u8; NUM_COLS]; NUM_ROWS]
duration_ms
u32
&mut self
delay
&mut D
led_matrix
[[u8; NUM_COLS]; NUM_ROWS]
duration_ms
u32