Coder Social home page Coder Social logo

sense-hat-examples's Introduction

Sense HAT examples

Example programs using the Sense HAT - particularly for the Astro Pi competition

About

British ESA astronaut Tim Peake is going to the International Space Station for 6 months at the end of 2015 and taking two Raspberry Pi computers to run experiments coded by participants in the Astro Pi coding competition for UK schools.

The Sense HAT is the hardware attachment board mounted to the Pis on the ISS, and will be available to the public as a product soon.

The Raspberry Pi Foundation have created a Python API to provide access to the board's LED matrix and sensors. See the documentation at pythonhosted.org/sense-hat

Usage

With a Sense HAT on a Raspberry Pi, and the firmware and Python library installed (see Sense HAT software installation), download or clone this repository, enter the python directory and run the examples with Python 3 or Python 2.

e.g.

git clone git://github.com/bennuttall/astro-pi-examples
cd astro-pi-examples/python
python3 random_sparkles.py

Examples

Random Sparkles

Let your Sense HAT shine with pride

Conway's Game of Life

Conway's Game of Life is a zero-player cellular automaton game

The game is randomly generated each time. Some games will be over very quickly, others will last a few generations. Press Ctrl + C to quit and then run it again.

Minecraft Colour

Walk around a Minecraft world and the Sense HAT will light up the colour of the block you're standing on

Be sure to open a Minecraft world first

Minecraft Map

Walk around a Minecraft world and the Sense HAT will show an 8x8 map of your player's surroundings

Be sure to open a Minecraft world first. Note blocks are cached for speed so alterations are not accounted for.

Colour Match Game

Two colours are selected at random and shown on the Sense HAT - controlling the RGB values with the keyboard you have to try to match the middle squares with the outside colour

Keys:

r: increase red
t: decrease red
g: increase green
h: decrease green
b: increase blue
n: decrease blue
esc: give up

Jokes

One line jokes scrolling on your Sense HAT display

Choose your own jokes list

Geeky Jokes

One line programmer jokes scrolling on your Sense HAT display

Requires pyjokes

Astro Cam

Stream a scaled-down picture from the camera module to the Sense HAT's LED matrix

Requires a camera module

Temperature Bar Graph

Show a bar graph of the temperature in real time

Humidity Bar Graph

Show a bar graph of the humidity in real time

Licence

All examples provided are free to use for any purpose, with or without attribution.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.