Log number of lights
This commit is contained in:
parent
1eb6f0f51a
commit
0c84fda192
16
src/main.rs
16
src/main.rs
@ -53,15 +53,19 @@ fn main() -> ProgramResult<()> {
|
|||||||
|
|
||||||
let (message_tx, message_rx) = channel::<error::Message>();
|
let (message_tx, message_rx) = channel::<error::Message>();
|
||||||
|
|
||||||
|
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<()> {
|
make_child(message_tx.clone(), move |message_tx| -> ProgramResult<()> {
|
||||||
let mut strip = LedStrip::new(strip::Config {
|
let mut strip = LedStrip::new(strip::Config {
|
||||||
// I have 89 right now, but start off with 20
|
// I have 89 right now, but start off with 20
|
||||||
num_lights: std::env::var("NUM_LIGHTS")
|
num_lights,
|
||||||
.as_ref()
|
|
||||||
.map(String::as_str)
|
|
||||||
.unwrap_or("89")
|
|
||||||
.parse()
|
|
||||||
.unwrap(),
|
|
||||||
// Skip 14 lights
|
// Skip 14 lights
|
||||||
shift_lights: 14,
|
shift_lights: 14,
|
||||||
// Scaling factor (scale 0..255)
|
// Scaling factor (scale 0..255)
|
||||||
|
Loading…
Reference in New Issue
Block a user