diff --git a/harrogate/Cargo.toml b/harrogate/Cargo.toml index 73f313e..42caf24 100644 --- a/harrogate/Cargo.toml +++ b/harrogate/Cargo.toml @@ -21,6 +21,7 @@ valentines-2020 = ["replace-default"] st-patricks-day = ["replace-default"] july-4 = ["replace-default"] halloween-2020 = ["replace-default"] +november-2020 = ["replace-default"] [dependencies] house = { path = "../house" } diff --git a/harrogate/src/main.rs b/harrogate/src/main.rs index af6f6b9..5a41ee9 100644 --- a/harrogate/src/main.rs +++ b/harrogate/src/main.rs @@ -12,6 +12,7 @@ mod valentines_2020; mod st_patricks_day; mod july_4; mod halloween_2020; +mod november_2020; mod door_light; #[entry] @@ -39,6 +40,9 @@ fn main() -> ! { #[cfg(feature = "halloween-2020")] halloween_2020::run(&mut lights); + #[cfg(feature = "november-2020")] + november_2020::run(&mut lights); + #[cfg(not(feature = "replace-default"))] door_light::run(&mut lights); } diff --git a/harrogate/src/november_2020.rs b/harrogate/src/november_2020.rs new file mode 100644 index 0000000..f106aa4 --- /dev/null +++ b/harrogate/src/november_2020.rs @@ -0,0 +1,27 @@ +use super::delay; +use core::iter::repeat; +use house::Harrogate; +use lights::rgb::Rgb; +use lights::{HardwareRgb, Lights}; + +const YELLOW: Rgb = Rgb(255, 195, 31); +const ORANGE: Rgb = Rgb(220, 117, 0); +const PUMPKIN: Rgb = Rgb(172, 67, 12); +const BROWN: Rgb = Rgb(118, 41, 0); +const RED: Rgb = Rgb(130, 18, 16); +const OFF: Rgb = Rgb(0, 0, 0); + +#[allow(dead_code)] +#[inline(always)] +pub fn run(lights: &mut impl Lights) -> ! { + let pattern = Harrogate { + porch_back: [OFF, OFF].iter().cloned().chain(repeat(BROWN)), + porch_front: repeat(OFF), + }; + + loop { + pattern.clone().render_to(lights); + + delay(48_000_000); + } +}