diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2020-12-05 00:05:09 -0700 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2020-12-05 00:05:09 -0700 |
commit | 04da2a442392c5bf3dcf4ca4611f42af7b35e596 (patch) | |
tree | 04b79ad25736db140ff98309cf3806c187b0991d /src | |
parent | 64b827a84ac87bf39e13a570cbd80ef0baa2b913 (diff) | |
download | stm32l4-working.tar.gz stm32l4-working.tar.bz2 stm32l4-working.zip |
Add a little white flair to the LED stripworking
Diffstat (limited to 'src')
-rw-r--r-- | src/kern/main.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/kern/main.c b/src/kern/main.c index 48967c7..fab2eb9 100644 --- a/src/kern/main.c +++ b/src/kern/main.c @@ -125,7 +125,13 @@ int main() brightness = 3 * byte_sin(time / 5000) / 4 + 63; - uint32_t white = amp(byte_sin(time / 6310 + i / 4)); + /* Add a little white flair that comes around every once in a while. */ + uint32_t white = time / 137 + i * 4; + if ((white / 256) % 8 == 0) { + white = amp(byte_sin(white)); + } else { + white = 0; + } ws2812b_write_rgb_sync( drv, |