From c25545f4dd24848d97a208f181b42bdecb634f37 Mon Sep 17 00:00:00 2001
From: bernd <bernd@heizung>
Date: Sun, 22 Dec 2024 23:13:50 +0100
Subject: [PATCH] make color-wheel a bit darker, for now

---
 firmware/rust1/src/bin/heizung.rs | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/firmware/rust1/src/bin/heizung.rs b/firmware/rust1/src/bin/heizung.rs
index 6b1fc1e..b3b46b7 100644
--- a/firmware/rust1/src/bin/heizung.rs
+++ b/firmware/rust1/src/bin/heizung.rs
@@ -332,7 +332,6 @@ async fn reset_soon(delay: Duration) {
 /// Input a value 0 to 255 to get a color value
 /// The colours are a transition r - g - b - back to r.
 fn wheel(mut wheel_pos: u8) -> RGB8 {
-    //return (0, 255, 0).into();
     wheel_pos = 255 - wheel_pos;
     if wheel_pos < 85 {
         return (255 - wheel_pos * 3, 0, wheel_pos * 3).into();
@@ -368,7 +367,9 @@ async fn ws2812_task(pio: PIO1, pin: PIN_2, dma: DMA_CH3) {
         for j in 0..(256 * 5) {
             //debug!("New Colors:");
             for i in 0..NUM_LEDS {
-                data[i] = wheel((((i * 256) as u16 / NUM_LEDS as u16 + j as u16) & 255) as u8);
+                let mut color = wheel((((i * 256) as u16 / NUM_LEDS as u16 + j as u16) & 255) as u8);
+                color /= 8;
+                data[i] = color;
                 //debug!("R: {} G: {} B: {}", data[i].r, data[i].g, data[i].b);
             }
             ws2812.write(&data).await;
-- 
GitLab