Create November display
This commit is contained in:
parent
bcc9bef3fd
commit
22cea4f23a
3 changed files with 32 additions and 0 deletions
|
@ -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" }
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
27
harrogate/src/november_2020.rs
Normal file
27
harrogate/src/november_2020.rs
Normal file
|
@ -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<Pixel = HardwareRgb>) -> ! {
|
||||
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);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue