-
Notifications
You must be signed in to change notification settings - Fork 36
Sense HAT(1)
This page introduces some tutorials of BlockPi(v1.1.0+) controlling the Sense HAT expansion board.
If you don't have a physical Sense HAT, you can use the Sense HAT Emulator on your Raspbian to emulate it.
See the video bellow:
https://video.zhihu.com/video/1221104755663024128
First of all, initialize the Sense HAT, tick Emulator if you're using it. Low lightness mode is useful in dark environment.
To display the red light symbol:
To display the green light symbol:
To display the green reversed counter:
The whole program:
The save file is here(Right-click then save-as).
Displays direction letter like a compass, see the video bellow:
https://video.zhihu.com/video/1221105094928134144
0 degree(North) of the compass is the direction of the USB ports on the RPi board, so you have to turn the LED Matrix 90 degrees clockwise.
The save file is here.
A more premium compass, indicates North. Video bellow:
https://www.zhihu.com/video/1221105403939074048
First, display a circle on the LED Matrix. These are the indexes to the pixels you need:
Save the 20 pixels in a list in turn:
Be advised that the X-Y coordinate of the left-top of the Matrix is [0, 0], and pixel No.39 is [7, 4]. Use modulo and exact division to get the coordinates and light the pixels.
Get the index of North direction and turn the pixel red. You should reverse the compass data and divide it to 20 parts. When the red pixel moves, don't forget to turn the previous one blue.
The whole program:
The save file is here.