Sense-Hat (AstroPi)
Features
8x8 RGB LED programmable matrix
Joystick
Humidity sensor
Gyroscope
Accelerometer
Temperature
Barometric pressure
Magnetometer
8M 1080p Camera
6 general purpose programmable buttons
Sense-Hat software comes pre installed on Raspbian for the Pi
If not already installed
$ sudo aptitude update
$ sudo aptitude install sense-hat
You will have to manually edit /boot/config.txt
add this line to the bottom
dtoverlay=rpi-sense
save the file, then reboot
$ sudo reboot
Sample Python code: to test the light grid
from sense_hat import SenseHat
import random
import time
sense = SenseHat()
sense.clear()
white=[255,255,255]
black=[0,0,0]
for loop in range(0,500):
x1=random.randint(0,7)
y1=random.randint(0,7)
sense.set_pixel(x1,y1,white)
x2=random.randint(0,7)
y2=random.randint(0,7)
sense.set_pixel(x2,y2,white)
x3=random.randint(0,7)
y3=random.randint(0,7)
sense.set_pixel(x3,y3,white)
x4=random.randint(0,7)
y4=random.randint(0,7)
sense.set_pixel(x4,y4,white)
x5=random.randint(0,7)
y5=random.randint(0,7)
sense.set_pixel(x5,y5,white)
sense.set_pixel(x1,y1,black)
sense.set_pixel(x2,y2,black)
sense.set_pixel(x3,y3,black)
sense.set_pixel(x4,y4,black)
sense.set_pixel(x5,y5,black)
sense.clear(white)
time.sleep(.05)
sense.clear()