St. Patrick's Day = green
This commit is contained in:
parent
262c45a668
commit
3ee29b41f9
3 changed files with 27 additions and 0 deletions
|
@ -18,6 +18,7 @@ december-01-2019 = ["replace-default"]
|
||||||
december-21-2019 = ["replace-default"]
|
december-21-2019 = ["replace-default"]
|
||||||
december-24-2019 = ["replace-default"]
|
december-24-2019 = ["replace-default"]
|
||||||
valentines-2020 = ["replace-default"]
|
valentines-2020 = ["replace-default"]
|
||||||
|
st-patricks-day = ["replace-default"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
house = { path = "../house" }
|
house = { path = "../house" }
|
||||||
|
|
|
@ -9,6 +9,7 @@ mod december_01_2019;
|
||||||
mod december_21_2019;
|
mod december_21_2019;
|
||||||
mod december_24_2019;
|
mod december_24_2019;
|
||||||
mod valentines_2020;
|
mod valentines_2020;
|
||||||
|
mod st_patricks_day;
|
||||||
mod door_light;
|
mod door_light;
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
|
@ -27,6 +28,9 @@ fn main() -> ! {
|
||||||
#[cfg(feature = "valentines-2020")]
|
#[cfg(feature = "valentines-2020")]
|
||||||
valentines_2020::run(&mut lights);
|
valentines_2020::run(&mut lights);
|
||||||
|
|
||||||
|
#[cfg(feature = "st-patricks-day")]
|
||||||
|
st_patricks_day::run(&mut lights);
|
||||||
|
|
||||||
#[cfg(not(feature = "replace-default"))]
|
#[cfg(not(feature = "replace-default"))]
|
||||||
door_light::run(&mut lights);
|
door_light::run(&mut lights);
|
||||||
}
|
}
|
||||||
|
|
22
harrogate/src/st_patricks_day.rs
Normal file
22
harrogate/src/st_patricks_day.rs
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue