Add faint backlighting for decorations between lightning.
This commit is contained in:
parent
ce5b674920
commit
bcc9bef3fd
1 changed files with 7 additions and 5 deletions
|
@ -4,6 +4,7 @@ use house::{Harrogate, PORCH_BACK_LEN, PORCH_FRONT_LEN};
|
||||||
use lights::{murmurf, rgb::Rgb, HardwareRgb, Lights};
|
use lights::{murmurf, rgb::Rgb, HardwareRgb, Lights};
|
||||||
|
|
||||||
const BLACK: Rgb = Rgb(0, 0, 0);
|
const BLACK: Rgb = Rgb(0, 0, 0);
|
||||||
|
const DIM: Rgb = Rgb(92, 92, 92);
|
||||||
const LIGHTNING: Rgb = Rgb(255, 255, 220);
|
const LIGHTNING: Rgb = Rgb(255, 255, 220);
|
||||||
|
|
||||||
const ORANGE: Rgb = Rgb(255, 150, 0);
|
const ORANGE: Rgb = Rgb(255, 150, 0);
|
||||||
|
@ -29,21 +30,22 @@ pub fn run(lights: &mut impl Lights<Pixel = HardwareRgb>) -> ! {
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
// clear
|
// clear
|
||||||
back_buffer.iter_mut().for_each(|pix| *pix = BLACK);
|
back_buffer.iter_mut().for_each(|pix| *pix = DIM);
|
||||||
draw(&back_buffer);
|
draw(&back_buffer);
|
||||||
|
|
||||||
// delay 4-20 seconds
|
// delay 3-15 seconds
|
||||||
delay(TIC * (murmurf(&mut rng) % 160 + 40));
|
delay(TIC * (murmurf(&mut rng) % 120 + 30));
|
||||||
|
|
||||||
// flash 1
|
// flash 1
|
||||||
|
back_buffer.iter_mut().for_each(|pix| *pix = BLACK);
|
||||||
flash(&mut rng, &mut back_buffer);
|
flash(&mut rng, &mut back_buffer);
|
||||||
draw(&back_buffer);
|
draw(&back_buffer);
|
||||||
delay(TIC);
|
delay(TIC * 2);
|
||||||
|
|
||||||
// flash 2
|
// flash 2
|
||||||
flash(&mut rng, &mut back_buffer);
|
flash(&mut rng, &mut back_buffer);
|
||||||
draw(&back_buffer);
|
draw(&back_buffer);
|
||||||
delay(TIC * 2);
|
delay(TIC * 3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue