add heartbeat led to july 4
This commit is contained in:
parent
3cb7fc1a57
commit
6cc39d3a9b
1 changed files with 21 additions and 21 deletions
|
@ -15,28 +15,28 @@ const FULL_PORCH: usize = 150;
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub fn run(lights: &mut impl Lights<Pixel = HardwareRgb>) -> ! {
|
pub fn run(lights: &mut impl Lights<Pixel = HardwareRgb>) -> ! {
|
||||||
let stars = [BLUE, WHITE, BLUE]
|
let mut heartbeat = false;
|
||||||
.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))
|
|
||||||
.take(FULL_PORCH);
|
|
||||||
|
|
||||||
let pattern = Harrogate {
|
|
||||||
porch_back: stripes,
|
|
||||||
porch_front: stars,
|
|
||||||
};
|
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
pattern.clone().render_to(lights);
|
heartbeat = !heartbeat;
|
||||||
|
|
||||||
delay(1_000_000);
|
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).take(6))
|
||||||
|
.chain(repeat(if heartbeat { RED } else { OFF }))
|
||||||
|
.take(FULL_PORCH);
|
||||||
|
|
||||||
|
let pattern = Harrogate {
|
||||||
|
porch_back: stripes,
|
||||||
|
porch_front: stars,
|
||||||
|
};
|
||||||
|
|
||||||
|
pattern.render_to(lights);
|
||||||
|
|
||||||
|
delay(24_000_000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue