From bd4de160152eef84fd0cbadcb6b234e93d12b431 Mon Sep 17 00:00:00 2001 From: Tangent Wantwight Date: Sun, 4 Jul 2021 20:44:58 -0400 Subject: [PATCH] WIP debugging --- house/src/lib.rs | 2 +- itsybitsy_m0_lights/src/lib.rs | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/house/src/lib.rs b/house/src/lib.rs index 9928bd7..8e7c2b3 100644 --- a/house/src/lib.rs +++ b/house/src/lib.rs @@ -39,7 +39,7 @@ where buffer[PORCH_BACK_LEN + i] = white_balance(correct(&pixel), PORCH_WHITE); } - buffer.iter().render_to(lights); + buffer.iter().take(225).render_to(lights); } } diff --git a/itsybitsy_m0_lights/src/lib.rs b/itsybitsy_m0_lights/src/lib.rs index 0786634..aba4915 100644 --- a/itsybitsy_m0_lights/src/lib.rs +++ b/itsybitsy_m0_lights/src/lib.rs @@ -46,10 +46,10 @@ pub fn boot() -> NeopixelLights< // experimentally, there is some unknown overhead // but these timings appear to work for me: -const ZERO_HIGH_CYCLES: u32 = 11 - 8; -const ONE_HIGH_CYCLES: u32 = 29 - 8; -const ZERO_LOW_CYCLES: u32 = 29 - 8; -const ONE_LOW_CYCLES: u32 = 11 - 8; +const ZERO_HIGH_CYCLES: u32 = 2; +const ONE_HIGH_CYCLES: u32 = 9; +const ZERO_LOW_CYCLES: u32 = 10; +const ONE_LOW_CYCLES: u32 = 10; const LATCH_CYCLES: u32 = 15000; // about 300us pub struct NeopixelLights { @@ -87,6 +87,7 @@ where self.write(byte & 0x04 != 0); self.write(byte & 0x02 != 0); self.write(byte & 0x01 != 0); + delay(5); } /// Blink light, probably to indicate a loop is still running