add heartbeat led to july 4

This commit is contained in:
Tangent Wantwight 2021-07-06 00:19:42 -04:00
parent 3cb7fc1a57
commit 6cc39d3a9b

View file

@ -15,18 +15,19 @@ const FULL_PORCH: usize = 150;
#[allow(dead_code)]
#[inline(always)]
pub fn run(lights: &mut impl Lights<Pixel = HardwareRgb>) -> ! {
let stars = [BLUE, WHITE, BLUE]
.iter()
.cycle()
.take(FULL_PORCH)
.cloned();
let mut heartbeat = false;
loop {
heartbeat = !heartbeat;
let stars = [BLUE, WHITE, BLUE].iter().cycle().take(FULL_PORCH).cloned();
let stripes = repeat(RED)
.take(11)
.chain(repeat(WHITE).take(11))
.cycle()
.take(11 * 12)
.chain(repeat(RED).take(11))
.chain(repeat(OFF))
.chain(repeat(OFF).take(6))
.chain(repeat(if heartbeat { RED } else { OFF }))
.take(FULL_PORCH);
let pattern = Harrogate {
@ -34,9 +35,8 @@ pub fn run(lights: &mut impl Lights<Pixel = HardwareRgb>) -> ! {
porch_front: stars,
};
loop {
pattern.clone().render_to(lights);
pattern.render_to(lights);
delay(1_000_000);
delay(24_000_000);
}
}