Sense HAT Christmas projects

Just imagine: you’re elbows deep in Christmas cheer, and the rest of the family wants to know what that chunk of circuit board you found in the toe of your stocking does. Here are some demonstrations for them.

First up, here’s a neat little project for those of you who have lost the dice from your favourite Christmas board game. (I swear my Mum hides the dice so she doesn’t have to join in.) Meet the Sense HAT dice (or die), from Giles Booth.

The code he’s used is very pleasingly tight and tidy (we expect nothing less of you, UK teachers); you can find it on his website.

What about a using your Sense HAT to build a Christmas ornament? Here’s a tree (sideways for arcane reasons we do not understand) from Jesús Chitty, with the code you’ll need to make your own available on GitHub.

Dan Fisher (@fluffywyvern on Twitter, who’s new at Pi Towers and sits opposite me – hi Dan!) has made a video of his Sense HAT running one of our website resources: the Marble Maze. You can learn how to make your own, and find out about pitch, roll and yaw and how the Sense HAT’s gyroscopes work, here in our resources section.

 

We’ve got lots more resources you can build with your Sense HAT (and plenty for which you won’t need any add-ons at all) this Christmas – let us know if you make any in the comments, and please take some video!

8 comments

Toby avatar

Cool.

Martin O'Hanlon avatar

Well done Dan. Nearly as good as the ‘Weeping Angel’ he made at Picademy.

ThomasS avatar

Great projects! Especially like the dice. Such a great idea and yet so simple.

Steve Amor avatar

I like the die.
I made a clock – sorry, no video
https://github.com/SteveAmor/Raspberry-Pi-Sense-Hat-Clock

Dexter N Muir avatar

Great project – a bit like an electronic “portable pegball”. I’m wondering if this could be the basis of a full-screen one? sort-of like using the sensors to control a “Pac-Man” type game? Wassay?:)

kusti8 avatar

Ooh goody! I’m getting one for Christmas and can’t wait to try it out when it comes.

Someone avatar

I Like The Dice Roller But I Could Not Watch The Vidieo…

So I Made My Own:
————————————————————
from sense_hat import SenseHat
import random, time
sense = SenseHat()
b = (80, 80, 80)
c = (0, 255, 255)
sense.clear()
N1= [b, b, b, b, b, b, b, b,
b, b, b, b, b, b, b, b,
b, b, b, b, b, b, b, b,
b, b, b, c, c, b, b, b,
b, b, b, c, c, b, b, b,
b, b, b, b, b, b, b, b,
b, b, b, b, b, b, b, b,
b, b, b, b, b, b, b, b]
N2P1= [c, c, b, b, b, b, b, b,
c, c, b, b, b, b, b, b,
b, b, b, b, b, b, b, b,
b, b, b, b, b, b, b, b,
b, b, b, b, b, b, b, b,
b, b, b, b, b, b, b, b,
b, b, b, b, b, b, c, c,
b, b, b, b, b, b, c, c]
N2P2= [b, b, b, b, b, b, c, c,
b, b, b, b, b, b, c, c,
b, b, b, b, b, b, b, b,
b, b, b, b, b, b, b, b,
b, b, b, b, b, b, b, b,
b, b, b, b, b, b, b, b,
c, c, b, b, b, b, b, b,
c, c, b, b, b, b, b, b]

N3P1= [c, c, b, b, b, b, b, b,
c, c, b, b, b, b, b, b,
b, b, b, b, b, b, b, b,
b, b, b, c, c, b, b, b,
b, b, b, c, c, b, b, b,
b, b, b, b, b, b, b, b,
b, b, b, b, b, b, c, c,
b, b, b, b, b, b, c, c]
N3P2= [b, b, b, b, b, b, c, c,
b, b, b, b, b, b, c, c,
b, b, b, b, b, b, b, b,
b, b, b, c, c, b, b, b,
b, b, b, c, c, b, b, b,
b, b, b, b, b, b, b, b,
c, c, b, b, b, b, b, b,
c, c, b, b, b, b, b, b]
N4= [c, c, b, b, b, b, c, c,
c, c, b, b, b, b, c, c,
b, b, b, b, b, b, b, b,
b, b, b, b, b, b, b, b,
b, b, b, b, b, b, b, b,
b, b, b, b, b, b, b, b,
c, c, b, b, b, b, c, c,
c, c, b, b, b, b, c, c]
N5= [c, c, b, b, b, b, c, c,
c, c, b, b, b, b, c, c,
b, b, b, b, b, b, b, b,
b, b, b, c, c, b, b, b,
b, b, b, c, c, b, b, b,
b, b, b, b, b, b, b, b,
c, c, b, b, b, b, c, c,
c, c, b, b, b, b, c, c]
N6= [c, c, b, b, b, b, c, c,
c, c, b, b, b, b, c, c,
b, b, b, b, b, b, b, b,
c, c, b, b, b, b, c, c,
c, c, b, b, b, b, c, c,
b, b, b, b, b, b, b, b,
c, c, b, b, b, b, c, c,
c, c, b, b, b, b, c, c]
def color(lst):
sense.clear()
x2 = 7
y2 = 7
li = 0
for y in range(0, 4):
for x in range(0, 8):
#sense.clear()
sense.set_pixel(x, y, lst[li])
#sense.set_pixel(y, x, b)
sense.set_pixel(x2, y2, lst[li])
#sense.set_pixel(y2, x2, b)
x2 = x2 – 1
time.sleep(0.05)
li = li + 1
y2 = y2 – 1
x2 = 7
while True:
num = random.randint(1, 6)
if (num == 1):
color(N1)
elif (num == 2):
if (random.randint(1, 2) == 1):
color(N2P1)
else:
color(N2P2)
elif (num == 3):
if (random.randint(1, 2) == 1):
color(N3P1)
else:
color(N3P2)
elif (num == 4):
color(N4)
elif (num == 5):
color(N5)
elif (num == 6):
color(N6)
raw_input(“”)

————————————————————

Kari avatar

Has anybody got magnetometer calibrated? I got Sense Hat a month ago and could not find how to do that and gave up. I tried to follow instructions in this link, but never succeeded.

https://www.raspberrypi.org/forums/viewtopic.php?f=104&t=109064&p=750616#p810193

Comments are closed