-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathSpookySlow.cpp
More file actions
26 lines (21 loc) · 749 Bytes
/
SpookySlow.cpp
File metadata and controls
26 lines (21 loc) · 749 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/*
G35: An Arduino library for GE Color Effects G-35 holiday lights.
Copyright © 2011 The G35 Authors. Use, modification, and distribution are
subject to the BSD license as described in the accompanying LICENSE file.
By Mike Tsao <https://github.com/sowbug>.
See README for complete attributions.
*/
#include <SpookySlow.h>
SpookySlow::SpookySlow(G35& g35) : LightProgram(g35), remaining_(0) {
}
uint32_t SpookySlow::Do() {
if (remaining_ == 0) {
remaining_ = rand() % (light_count_ >> 3);
g35_.fill_color(0, light_count_, 255, COLOR_BLACK);
}
if (remaining_-- > 2) {
g35_.set_color(rand() % light_count_, G35::MAX_INTENSITY,
(rand() & 1) ? COLOR_ORANGE : COLOR_PALE_ORANGE);
}
return 1000;
}