Set up build tools for the raspberry pi, along with a demo program for controlling SK9822 lights. #97

Merged
savanni merged 6 commits from rasp-pi-build-tools into main 2023-11-14 13:28:15 +00:00
1 changed files with 7 additions and 4 deletions
Showing only changes of commit c46ab1b389 - Show all commits

View File

@ -29,8 +29,8 @@ fn send_byte<I, J, P>(
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,