Halloween 2022

This commit is contained in:
Tangent Wantwight 2022-10-05 19:57:17 -04:00
parent 175a629b6e
commit f307f448e3
3 changed files with 42 additions and 0 deletions

View File

@ -24,6 +24,7 @@ st-patricks-day = ["replace-default"]
july-4 = ["replace-default"]
halloween-2020 = ["replace-default"]
halloween-2021 = ["replace-default"]
halloween-2022 = ["replace-default"]
new-years-eve-2020 = ["replace-default"]
november-2020 = ["replace-default"]

View File

@ -0,0 +1,37 @@
//! purple-and-green with "lightning" flashes
use core::iter::repeat;
use super::delay;
use house::{Harrogate, PORCH_BACK_LEN, PORCH_FRONT_LEN};
use lights::{rgb::Rgb, HardwareRgb, Lights};
const ORANGE: Rgb = Rgb(255, 150, 0);
const PURPLE: Rgb = Rgb(100, 0, 128);
// tenth of a second
const TIC: u32 = 4_800_000;
#[allow(dead_code)]
#[inline(always)]
pub fn run(lights: &mut impl Lights<Pixel = HardwareRgb>) -> ! {
let mut ring = repeat(PURPLE)
.take(PORCH_BACK_LEN)
.chain(repeat(ORANGE).take(PORCH_FRONT_LEN))
.cycle();
loop {
let back = ring.clone();
let front = back.clone().skip(PORCH_BACK_LEN);
// render
Harrogate {
porch_back: back,
porch_front: front,
}
.render_to(lights);
ring.next();
delay(TIC * 2);
}
}

View File

@ -15,6 +15,7 @@ mod st_patricks_day;
mod july_4;
mod halloween_2020;
mod halloween_2021;
mod halloween_2022;
mod november_2020;
mod new_years_eve_2020;
mod door_light;
@ -53,6 +54,9 @@ fn main() -> ! {
#[cfg(feature = "halloween-2021")]
halloween_2021::run(&mut lights);
#[cfg(feature = "halloween-2022")]
halloween_2022::run(&mut lights);
#[cfg(feature = "new-years-eve-2020")]
new_years_eve_2020::run(&mut lights);