Skip to content

Instantly share code, notes, and snippets.

View tuftii's full-sized avatar

Claire Pollard tuftii

View GitHub Profile
@tuftii
tuftii / hb.py
Created January 18, 2019 16:40
Jam-Hat demo
from jamhat import JamHat
from time import sleep
hat = JamHat()
tune = ['G5', 'G5', 'A5', 'G5', 'C6', 'B5', 0,
'G5', 'G5', 'A5', 'G5', 'D6', 'C6', 0,
'G5', 'G5', 'GS6', 'E6', 'C6', 'B5', 'A5', 0,
'F6', 'F6', 'E6', 'C6', 'D6', 'C6']
@tuftii
tuftii / fireworks.py
Created November 4, 2018 09:25
Raspberry Pi Sense Hat Fireworks
# This example gist makes fireworks appear on the Raspberry Pi Sense Hat. This could be adapted for other LED based Raspberry Pi Hats.
from sense_hat import SenseHat
from time import sleep
from random import randint
import threading
DECAY = 0.7 # Colour decay of firework head.
SPEED = 0.1 # Speed of firework explosion.
DISPLAY_SPEED = 0.6 # Speed of firework launches.