fix blinking
This commit is contained in:
parent
f72ad4b616
commit
879648edc3
1 changed files with 6 additions and 4 deletions
10
src/main.rs
10
src/main.rs
|
@ -7,7 +7,7 @@ use rs_ws281x::{RawColor, Controller, ControllerBuilder, ChannelBuilder, StripTy
|
|||
use std::{thread, time};
|
||||
|
||||
pub const LED_SIZE: usize = 450; //450
|
||||
pub const BRIGHTNESS: u8 = 150;
|
||||
pub const BRIGHTNESS: u8 = 100;
|
||||
pub const LOOP_WAIT: u64 = 250;
|
||||
|
||||
fn main() {
|
||||
|
@ -35,7 +35,7 @@ fn main() {
|
|||
|
||||
//pattern parsing
|
||||
let mul_string = format_multiline(concat!(
|
||||
"val 0 0 255\n",
|
||||
"val 0 0 0\n",
|
||||
"val r 255"
|
||||
));
|
||||
let res: Result<Vec<Box<dyn Pattern>>, ParseError> = mul_string.iter()
|
||||
|
@ -51,9 +51,11 @@ fn main() {
|
|||
//pattern management
|
||||
loop {
|
||||
thread::sleep(time::Duration::from_millis(LOOP_WAIT));
|
||||
let c_lock = Arc::clone(&lock);
|
||||
let mut lights = c_lock.write().unwrap();
|
||||
for p in &pattern {
|
||||
let c_lock = Arc::clone(&lock);
|
||||
let mut lights = c_lock.write().unwrap();
|
||||
//let c_lock = Arc::clone(&lock);
|
||||
//let mut lights = c_lock.write().unwrap();
|
||||
p.execute(&mut lights);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue