Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Now lets have the house lights come on one by one randomly over a short time from 19:30 and off in the same manner at 07:10 ...
- if (isBetweenTimes(19,30,07,10)){
- EVERY_N_MILLISECONDS(10) { // Increase no. of ms to turn the lights on more slowly
- if (random8() == 0) { // Every 10 ms we have a 1 in 256 chance of lighting an LED
- leds[houses[random8(housesLength)]] = CRGB::Yellow;
- }
- }
- }
- //...and outside of these hours have them slowly turn off
- else {
- EVERY_N_MILLISECONDS(10) {
- if (random8() == 0) {
- leds[houses[random8(housesLength)]] = CRGB::Black;
- }
- }
- }
Add Comment
Please, Sign In to add comment