diff --git a/pico-blink/src/main.rs b/pico-blink/src/main.rs index cbe3672..57ff34a 100644 --- a/pico-blink/src/main.rs +++ b/pico-blink/src/main.rs @@ -29,8 +29,8 @@ fn send_byte( J: PinId, P: PullType, { - (0..7).for_each(|bit| { - if byte & (1 << (7 - bit)) > 0 { + (0..8).for_each(|bit| { + if byte & (1 << (8 - bit)) > 0 { data.set_high(); } else { data.set_low(); @@ -144,10 +144,13 @@ fn main() -> ! { &mut spi_clk, &mut delay, &[ - 0, 0, 0, 0, 0xf0, 0x80, 0x0, 0x0, 0xe1, 0x0, 0x80, 0x0, 0xe1, 0x0, 0x0, 0x80, 0xff, - 0xff, 0xff, 0xff, + 0xe1, 0x80, 0x00, 0x00, + 0xe1, 0x00, 0x80, 0x00, + 0xe1, 0x00, 0x00, 0x80, ], ); + spi_clk.set_low(); + spi_sdo.set_low(); /* spi.write(&[ 0, 0, 0, 0, 0xf0, 0x80, 0x0, 0x0, 0xe1, 0x0, 0x80, 0x0, 0xe1, 0x0, 0x0, 0x80, 0xff,