Skip to content
Snippets Groups Projects
Commit c25545f4 authored by bernd's avatar bernd
Browse files

make color-wheel a bit darker, for now

parent b407960a
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment