St. Patrick's Day = green

This commit is contained in:
Tangent Wantwight 2020-03-17 00:08:23 -04:00
parent 262c45a668
commit 3ee29b41f9
3 changed files with 27 additions and 0 deletions

View File

@ -18,6 +18,7 @@ december-01-2019 = ["replace-default"]
december-21-2019 = ["replace-default"]
december-24-2019 = ["replace-default"]
valentines-2020 = ["replace-default"]
st-patricks-day = ["replace-default"]
[dependencies]
house = { path = "../house" }

View File

@ -9,6 +9,7 @@ mod december_01_2019;
mod december_21_2019;
mod december_24_2019;
mod valentines_2020;
mod st_patricks_day;
mod door_light;
#[entry]
@ -27,6 +28,9 @@ fn main() -> ! {
#[cfg(feature = "valentines-2020")]
valentines_2020::run(&mut lights);
#[cfg(feature = "st-patricks-day")]
st_patricks_day::run(&mut lights);
#[cfg(not(feature = "replace-default"))]
door_light::run(&mut lights);
}

View File

@ -0,0 +1,22 @@
use super::delay;
use core::iter::repeat;
use house::Harrogate;
use lights::rgb::Rgb;
use lights::{HardwareRgb, Lights};
const GREEN: Rgb = Rgb(0, 255, 0);
#[allow(dead_code)]
#[inline(always)]
pub fn run(lights: &mut impl Lights<Pixel = HardwareRgb>) -> ! {
let pattern = Harrogate {
porch_back: repeat(GREEN),
porch_front: repeat(GREEN),
};
loop {
pattern.clone().render_to(lights);
delay(48_000_000);
}
}