Skip to content

Instantly share code, notes, and snippets.

@Ismael-VC
Forked from simonbyrne/spooky.jl
Created November 1, 2016 01:18
Show Gist options
  • Save Ismael-VC/585a9ec76e11ba4d8ff2d8aa712f876e to your computer and use it in GitHub Desktop.
Save Ismael-VC/585a9ec76e11ba4d8ff2d8aa712f876e to your computer and use it in GitHub Desktop.
For my Raspberry Pi powered jack-o'-lantern
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