From 0c84fda1921cb37ffa3e2be6a54f6f301ebd536c Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Mon, 20 Feb 2023 16:58:36 -0500 Subject: [PATCH] Log number of lights --- src/main.rs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/main.rs b/src/main.rs index 9888823..c827560 100644 --- a/src/main.rs +++ b/src/main.rs @@ -53,15 +53,19 @@ fn main() -> ProgramResult<()> { let (message_tx, message_rx) = channel::(); + let num_lights: u16 = std::env::var("NUM_LIGHTS") + .as_ref() + .map(String::as_str) + .unwrap_or("89") + .parse() + .unwrap(); + + eprintln!("Number of lights: {num_lights}"); + make_child(message_tx.clone(), move |message_tx| -> ProgramResult<()> { let mut strip = LedStrip::new(strip::Config { // I have 89 right now, but start off with 20 - num_lights: std::env::var("NUM_LIGHTS") - .as_ref() - .map(String::as_str) - .unwrap_or("89") - .parse() - .unwrap(), + num_lights, // Skip 14 lights shift_lights: 14, // Scaling factor (scale 0..255)