28 lines
724 B
Rust
28 lines
724 B
Rust
//! orange-and-purple with "lightning" flashes
|
|
use super::delay;
|
|
use house::{Harrogate, PORCH_BACK_LEN, PORCH_FRONT_LEN};
|
|
use lights::{rgb::Rgb, HardwareRgb, Lights};
|
|
|
|
const BLACK: Rgb = Rgb(0, 0, 0);
|
|
const ORANGE: Rgb = Rgb(255, 150, 0);
|
|
const PURPLE: Rgb = Rgb(100, 0, 128);
|
|
|
|
#[allow(dead_code)]
|
|
#[inline(always)]
|
|
pub fn run(lights: &mut impl Lights<Pixel = HardwareRgb>) -> ! {
|
|
let front_pattern = [PURPLE, ORANGE].iter().cycle().cloned();
|
|
|
|
let back_buffer = [BLACK; PORCH_BACK_LEN];
|
|
|
|
loop {
|
|
|
|
Harrogate {
|
|
porch_front: front_pattern.clone().take(PORCH_FRONT_LEN),
|
|
porch_back: back_buffer.iter().cloned()
|
|
}
|
|
.render_to(lights);
|
|
|
|
delay(12_000_000);
|
|
}
|
|
}
|