File tree Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -43,9 +43,9 @@ embedded-sdmmc = "0.2.1"
43
43
infrared = " 0.11.0"
44
44
panic-halt = " 0.2.0"
45
45
panic-semihosting = " 0.5.3"
46
- smart-leds = { git = " https://github.com/smart-leds-rs/smart-leds " }
46
+ smart-leds = " 0.3.0 "
47
47
st7735-lcd = " 0.6.1"
48
- ws2812-spi = {git = " https://github.com/smart-leds-rs/ws2812-spi-rs " }
48
+ ws2812-spi = { version = " 0.3.0 " , features = [] }
49
49
50
50
[features ]
51
51
rt = [" stm32g0/rt" ]
Original file line number Diff line number Diff line change @@ -39,17 +39,18 @@ fn main() -> ! {
39
39
let mut ws = ws2812:: Ws2812 :: new ( spi) ;
40
40
41
41
let mut cnt: usize = 0 ;
42
- let mut data: [ RGB < u8 > ; 8 ] = [ RGB :: default ( ) ; 8 ] ;
42
+ let mut data: [ RGB < u8 > ; 64 ] = [ RGB :: default ( ) ; 64 ] ;
43
43
loop {
44
44
for ( idx, color) in data. iter_mut ( ) . enumerate ( ) {
45
- * color = match ( cnt + idx) % 3 {
46
- 0 => RGB { r : 255 , g : 0 , b : 0 } ,
47
- 1 => RGB { r : 0 , g : 255 , b : 0 } ,
48
- _ => RGB { r : 0 , g : 0 , b : 255 } ,
45
+ * color = match ( cnt + idx) % 8 {
46
+ 0 => RGB { r : 8 , g : 0 , b : 0 } ,
47
+ 1 => RGB { r : 0 , g : 4 , b : 0 } ,
48
+ 2 => RGB { r : 0 , g : 0 , b : 2 } ,
49
+ _ => RGB { r : 0 , g : 0 , b : 0 } ,
49
50
} ;
50
51
}
51
52
ws. write ( data. iter ( ) . cloned ( ) ) . unwrap ( ) ;
52
53
cnt += 1 ;
53
- delay. delay ( 200 . ms ( ) ) ;
54
+ delay. delay ( 50 . ms ( ) ) ;
54
55
}
55
56
}
You can’t perform that action at this time.
0 commit comments