init Halloween 2020 to simple orange/purple

This commit is contained in:
Tangent Wantwight 2020-10-07 19:38:56 -04:00
parent 809f848252
commit fbc4eb1e86
3 changed files with 32 additions and 0 deletions

View file

@ -20,6 +20,7 @@ december-24-2019 = ["replace-default"]
valentines-2020 = ["replace-default"] valentines-2020 = ["replace-default"]
st-patricks-day = ["replace-default"] st-patricks-day = ["replace-default"]
july-4 = ["replace-default"] july-4 = ["replace-default"]
halloween-2020 = ["replace-default"]
[dependencies] [dependencies]
house = { path = "../house" } house = { path = "../house" }

View file

@ -0,0 +1,27 @@
//! 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);
}
}

View file

@ -11,6 +11,7 @@ mod december_24_2019;
mod valentines_2020; mod valentines_2020;
mod st_patricks_day; mod st_patricks_day;
mod july_4; mod july_4;
mod halloween_2020;
mod door_light; mod door_light;
#[entry] #[entry]
@ -35,6 +36,9 @@ fn main() -> ! {
#[cfg(feature = "july-4")] #[cfg(feature = "july-4")]
july_4::run(&mut lights); july_4::run(&mut lights);
#[cfg(feature = "halloween-2020")]
halloween_2020::run(&mut lights);
#[cfg(not(feature = "replace-default"))] #[cfg(not(feature = "replace-default"))]
door_light::run(&mut lights); door_light::run(&mut lights);
} }