Last active
November 1, 2016 01:18
-
-
Save simonbyrne/4e476bcfb79216c3220b877c6d2bbe32 to your computer and use it in GitHub Desktop.
For my Raspberry Pi powered jack-o'-lantern
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using SenseHat | |
import SenseHat: RGB565 | |
function spooky(decay, arriv, refresh) | |
x = rand() | |
while true | |
x *= exp(-decay*refresh) | |
if rand() < arriv*refresh | |
x += (1-x)*rand() | |
end | |
led_display([RGB565(x,0,0) for i = 1:8, j = 1:8]) | |
end | |
sleep(refresh) | |
end | |
spooky(0.2,0.1,0.01) |
Should the sleep be inside the loop?
Good catch!
Seemed to get a good effect without it.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Should the sleep be inside the loop?