Adjust dbus sleep for aura crate

This commit is contained in:
Luke
2020-06-02 11:38:17 +12:00
parent d9fc7de5cb
commit e3eccef193
2 changed files with 11 additions and 6 deletions

View File

@@ -1,13 +1,18 @@
use rog_aura::AnimatrixDbusWriter;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut writer = AnimatrixDbusWriter::new()?;
const PANE1_PREFIX: [u8; 7] = [0x5e, 0xc0, 0x02, 0x01, 0x00, 0x73, 0x02];
const PANE2_PREFIX: [u8; 7] = [0x5e, 0xc0, 0x02, 0x74, 0x02, 0x73, 0x02];
let mut send_buffer = [vec![0; 640], vec![0; 640]];
fn main() {
let mut writer = AnimatrixDbusWriter::new().unwrap();
loop {
writer.write_image(&send_buffer)?;
for brightness in 0..0xFF {
let mut buffers = [vec![brightness; 640], vec![brightness; 640]];
buffers[0][..7].copy_from_slice(&PANE1_PREFIX);
buffers[0][..7].copy_from_slice(&PANE2_PREFIX);
//std::thread::sleep(std::time::Duration::from_millis(60));
writer.write_image(&buffers).unwrap();
}
}
}