Remember the Raspberry Pi Sense Hat? Originally designed for a mission to the International Space Station, the board has quite a few sensors onboard as well as an 8×8 RGB LED matrix. What can you do with an 8×8 screen? You might be surprised if you use [Ethan’s] Python Sense Hat animation library. You can get the full visual effect in the video below.
The code uses an array to represent the screen, which isn’t a big deal since there are only 64 elements. Turning on a particular element to animate, say, a pong puck, isn’t hard with or without the library. Here’s some code to do it with the library:
for x in range(0,7): ect.cell(image,[0,x],[randint(0,255), randint(0,255), randint(0,255)],0.1) ect.cell(image,[0,x],e,0.1) for x in range(7,0, -1): ect.cell(image,[0,x],[randint(0,255), randint(0,255), randint(0,255)],0.1) ect.cell(image,[0,x],e,0.1)
Each loop draws a box with a random color and then erases it before going to the next position. The second for loop makes the puck move in the opposite direction. You can probably deduce that the first argument is the screen array, the second is the position. The third argument sets the color, and the final argument sets an animation timer. Looking at the code, though, it does look like the timer blocks which is probably not going to work for some applications.
If that’s all there was, this wouldn’t be worth too much, but you can also draw triangles, circles, and squares. For example:
ect.circle(image,(4,4), 3, [randint(0,255), randint(0,255), randint(0,255)], 0.1)
We covered the Sense Hat awhile back. Of course, it does a lot more than just light up LEDs as you can see from this weather dashboard.
Is it possible for this array to sense touch? As in use the LED(s) as light sensors?
Doesn’t have to be super-accurate, just to be more interactive.
I’m not sure with the sense hat, but I remember an article way back that does just this. http://hackaday.com/2006/02/21/low-cost-sensing-and-communication-with-an-led/
“Remember the Raspberry Pi Sense Hat? Originally designed for a mission to the International Space Station, the board has quite a few sensors onboard as well as an 8×8 RGB LED matrix.”
No i do not, please elaborate.
To me it sounds a bit hoax-y, why would they allow DIY grade electronics on the ISS, that doesn’t sound right, at all.
We covered the >Sense Hat</ awhile back.
“We…”. “WE…”? I assume you are under the mistaken impression that the use of the ‘Papal “WE”‘ lends credibility to your statement. It does not.
@Oliver–congratulations; the ‘sense hat’ was a very forgettable use of a very forgettable processor. It was designed as nothing more than a grand-standing use of the RPi, much as are most ‘applications” of the rpi machine.
I would love to see the SBC that you designed and sold over 10 MILLION boards of!
Please share your links with all of us, we’d like to see your work here too.
Oh look, another Pi hater here to tell us all how we “are doing it wrong!”, luckily for us we are about to be saved! Oh joy!…
It exists, people like it and use it. Get over it already!
I believe the “We” in question refers to “Hackaday”, covering the Pi Hat before, if you even bother reading before you trash something.
Too lazy to google it or just being obstreperous?
https://www.raspberrypi.org/blog/astro-pi/
“What can you do with an 8×8 screen? You might be surprised”
Or not. That was an extremely boring video.