-
-
Save Ismael-VC/585a9ec76e11ba4d8ff2d8aa712f876e 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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment