The original inspiration for this whole experiment came from a @Rob Bishop (OCR) Raspberry Pi Recipe Card (ocr-recipe-card-twitter-led.pdf). The objective is to interact with Twitter using Python.
Sense Hat
The Sense Hat from Raspberry Pi was developed as part of the Astro Pi Project. The Sense Hat comes with its own library and a variety of hardware including: a 8×8 RGB LED matrix for output; a five-button joystick for user control; and the following sensors:
- Gyroscope used to measure the positioning of an object
- Accelerometer used to measure the rate of the velocity of an object
- Magnetometer that provides an electronic compass
- Temperature
- Barometric pressure
- Humidity
The purpose of this page is a quick guide to using the different aspects of the Sense Hat but for full details you should check out the API.
Python
Python is a highly readable language that is easy to use and learn hence it is gaining popularity as an education language. However, this should not lead anyone to consider it a child’s language for it is not. It is very powerful, flexible and platform independent. It supports many styles of programming from scripting and web design to GUI/Game development.
TKinter Drawing
TKinter is the easiest way to get drawing in Python.
Tkinter Events
Tkinter employs a type of programming called Event-Driven which means that the program runs in a endless loop waiting for things (events) to happen. In order for the program to respond to these events it needs to know what to listen for.
Push Button LED
This simple flashing LED (Light Emitting Diode) circuit is based on the ARDX 07 circuit from Oomlout. It serves as an excellent introduction to combine inputs and outputs. It uses a Pull Down Resistor.