From 13637c748fde840163a6035eedaa55a13dc4bf7b Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Tue, 21 Jan 2020 17:25:29 -0500 Subject: [PATCH] added more led logic --- src/main.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 5ca92a3..314dea7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -31,7 +31,18 @@ fn main() { match activeapp { app::ActiveApp::Roku => println!("The lights are light purple!"), - app::ActiveApp::Netflix => println!("The lights are red!"), + app::ActiveApp::Netflix => { + let mut panel = led::Led::new(256); + + let color: Vec = [0; 265].iter().map(|val| { + match val { + 0 => led::ColorRGB(0x03, 0x00, 0x00), + _ => panic!("Invalid color!"), + } + }).collect(); + + panel.set_leds(&color); + }, app::ActiveApp::Hulu => println!("The lights are green!"), app::ActiveApp::AmazonPrime => println!("The light are light blue!"), app::ActiveApp::Spotify => println!("The lights are light green!"),