diff --git a/harrogate/Cargo.toml b/harrogate/Cargo.toml index 0f17ec0..8d26626 100644 --- a/harrogate/Cargo.toml +++ b/harrogate/Cargo.toml @@ -22,6 +22,7 @@ valentines-2020 = ["replace-default"] st-patricks-day = ["replace-default"] july-4 = ["replace-default"] halloween-2020 = ["replace-default"] +new-years-eve-2020 = ["replace-default"] november-2020 = ["replace-default"] [dependencies] diff --git a/harrogate/src/main.rs b/harrogate/src/main.rs index 5932a51..82bac7f 100644 --- a/harrogate/src/main.rs +++ b/harrogate/src/main.rs @@ -14,6 +14,7 @@ mod st_patricks_day; mod july_4; mod halloween_2020; mod november_2020; +mod new_years_eve_2020; mod door_light; #[entry] @@ -44,6 +45,9 @@ fn main() -> ! { #[cfg(feature = "halloween-2020")] halloween_2020::run(&mut lights); + #[cfg(feature = "new-years-eve-2020")] + new_years_eve_2020::run(&mut lights); + #[cfg(feature = "november-2020")] november_2020::run(&mut lights); diff --git a/harrogate/src/new_years_eve_2020.rs b/harrogate/src/new_years_eve_2020.rs new file mode 100644 index 0000000..a36e601 --- /dev/null +++ b/harrogate/src/new_years_eve_2020.rs @@ -0,0 +1,23 @@ +use super::delay; +use core::iter::repeat; +use house::Harrogate; +use lights::rgb::Rgb; +use lights::{HardwareRgb, Lights}; + +const WHITE: Rgb = Rgb(255, 255, 255); +const YELLOW: Rgb = Rgb(255, 255, 0); + +#[allow(dead_code)] +#[inline(always)] +pub fn run(lights: &mut impl Lights) -> ! { + let pattern = Harrogate { + porch_back: repeat(YELLOW), + porch_front: repeat(WHITE), + }; + + loop { + pattern.clone().render_to(lights); + + delay(48_000_000); + } +}