fn draw_row<D: Grid>(row: u8, lp: &mut D, r: &Bounce) -> Err {
    match *r {
	Left(_,a,b,c,d,e,f,g,h) => {
	    let values : Vec<u8> = vec![a,b,c,d,e,f,g,h];
	    for x in 0..8 {
		lp.led_on(x as u8, row, values[x as usize])?;
	    }
	},
	Right(_,a,b,c,d,e,f,g,h) => {
	    let values : Vec<u8> = vec![a,b,c,d,e,f,g,h];
	    for x in 0..8 {
		lp.led_on(x as u8, row, values[x as usize])?;
	    }
	},
    }
    Ok(())
}
// Easily draw a row by referencing the Bounce type and the Launchpad
Easily draw a row by referencing the Bounce type and the Launchpad
Easily draw a row by referencing the Bounce type and the Launchpad
fn draw_row<D: Grid>(row: u8, lp: &mut D, r: &Bounce) -> Err {
    match *r {
	Left(_,a,b,c,d,e,f,g,h) => {
	    let values : Vec<u8> = vec![a,b,c,d,e,f,g,h];
	    for x in 0..8 {
		lp.led_on(x as u8, row, values[x as usize])?;
	    }
	},
	Right(_,a,b,c,d,e,f,g,h) => {
	    let values : Vec<u8> = vec![a,b,c,d,e,f,g,h];
	    for x in 0..8 {
		lp.led_on(x as u8, row, values[x as usize])?;
	    }
	},
    }
    Ok(())
}
fn draw_row < D : Grid > ( row : u8 , lp : & mut D , r : & Bounce ) -> Err { match * r { Left ( _ , a , b , c , d , e , f , g , h ) => { let values : Vec < u8 > = vec ! [ a b c d e f g h ] ; for x in 0 .. 8 { lp . led_on ( x as u8 , row , values [ x as usize ] ) ? ; } } , Right ( _ , a , b , c , d , e , f , g , h ) => { let values : Vec < u8 > = vec ! [ a b c d e f g h ] ; for x in 0 .. 8 { lp . led_on ( x as u8 , row , values [ x as usize ] ) ? ; } } , } Ok ( ( ) ) }
Easily draw a row by referencing the Bounce type and the Launchpad
Easily draw a row by referencing the Bounce type and the Launchpad
row
u8
lp
&mut D
r
&Bounce
row
u8
lp
&mut D
r
&Bounce