Compare commits
1 commit
cc18fdd3b4
...
8ae02e70a3
Author | SHA1 | Date | |
---|---|---|---|
8ae02e70a3 |
1 changed files with 3 additions and 3 deletions
|
@ -5,7 +5,7 @@ use std::sync::{Arc, RwLock};
|
||||||
use std::thread;
|
use std::thread;
|
||||||
use rs_ws281x::{RawColor, Controller, ControllerBuilder, ChannelBuilder, StripType};
|
use rs_ws281x::{RawColor, Controller, ControllerBuilder, ChannelBuilder, StripType};
|
||||||
|
|
||||||
pub const LED_SIZE: i32 = 450;
|
pub const LED_SIZE: usize = 450;
|
||||||
pub const BRIGHTNESS: u8 = 255;
|
pub const BRIGHTNESS: u8 = 255;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
@ -13,7 +13,7 @@ fn main() {
|
||||||
let lock = Arc::new(RwLock::new([p; LED_SIZE]));
|
let lock = Arc::new(RwLock::new([p; LED_SIZE]));
|
||||||
let lock_c = Arc::clone(&lock);
|
let lock_c = Arc::clone(&lock);
|
||||||
|
|
||||||
let controller = ControllerBuilder::new()
|
let controller: Controller = ControllerBuilder::new()
|
||||||
.channel(ChannelBuilder::new()
|
.channel(ChannelBuilder::new()
|
||||||
.pin(18)
|
.pin(18)
|
||||||
.count(LED_SIZE)
|
.count(LED_SIZE)
|
||||||
|
@ -24,7 +24,7 @@ fn main() {
|
||||||
.build();
|
.build();
|
||||||
thread::spawn(move || loop {
|
thread::spawn(move || loop {
|
||||||
let lights = lock_c.read().unwrap();
|
let lights = lock_c.read().unwrap();
|
||||||
run_lights(&controller, &lights);
|
run_lights(&lights);
|
||||||
});
|
});
|
||||||
let mut x: u8 = 0;
|
let mut x: u8 = 0;
|
||||||
loop {
|
loop {
|
||||||
|
|
Loading…
Reference in a new issue