Raspberry Pi Sense HAT

I recently acquired a Sense HAT for the Raspberry Pi. This is the same hardware that will be sent in to space as part of the Astro Pi mission. Here it is.

Sense HAT

It’s a shame that it’s made in China (PRC) and couldn’t be manufactured in Wales like the Pi is. I guess the cost is too high. Here is it installed on a wooden coupé pibow case.

HAT on pi

It’s pretty easy to program and the API is well documented. A nice touch is that you can configure the LEDs to rotate to whichever direction you have the Pi mounted. Here is a quick demo I knocked up.

pi

Here’s the Python code.

from sense_hat import SenseHat

sh = SenseHat()

X = [255, 0, 0]  # Red
O = [0, 0, 0]  # Black

pi = [
O, O, O, O, O, O, O, O,
X, X, X, X, X, X, X, X,
X, X, X, X, X, X, X, X,
O, X, X, O, O, X, X, O,
O, X, X, O, O, X, X, O,
O, X, X, O, O, X, X, O,
O, X, X, O, O, X, X, O,
O, O, O, O, O, O, O, O]

sh.set_pixels(pi)

There is a new worksheet available for making a magic 8 ball from the Sense HAT. It uses the accelerometer to detect shakes and displays a random message on the LED array.


This blog is treeware! If you found it useful then please plant a tree.
Donate a treeDonate a tree🌳🌳