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"]
st-patricks-day = ["replace-default"]
july-4 = ["replace-default"]
halloween-2020 = ["replace-default"]
[dependencies]
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 st_patricks_day;
mod july_4;
mod halloween_2020;
mod door_light;
#[entry]
@ -35,6 +36,9 @@ fn main() -> ! {
#[cfg(feature = "july-4")]
july_4::run(&mut lights);
#[cfg(feature = "halloween-2020")]
halloween_2020::run(&mut lights);
#[cfg(not(feature = "replace-default"))]
door_light::run(&mut lights);
}