From 3c058c71d0347cd759b4293503289e142602f103 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Sun, 8 Dec 2024 06:15:20 -0300 Subject: [PATCH] lib: Add panic if neopixel does not exist MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick José Pereira --- src/lib.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index a27966a54..075dd33dc 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -349,6 +349,13 @@ impl Navigator { } } + pub fn set_neopixel_rgbw(&mut self, colors: &[[u8; 4]]) { + self.get_rgb_behaviour() + .expect("No RGB controller available") + .set_colors_rgbw(colors) + .expect("Failed to set RGB colors"); + } + pub fn read_all(&mut self) -> SensorData { SensorData { adc: self.read_adc_all(),