Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Sense HAT Display Sequence

A small Raspberry Pi Sense HAT project that runs a continuous sequence of visual effects and sensor displays on the 8×8 LED matrix.

The program combines several Python scripts into one automated loop, with each effect running on a 1-minute cycle.

Features

The sequence includes:

  • 🌡️ Temperature display — scrolls the current CPU/Sense HAT temperature across the LED matrix.
  • 📊 Temperature graph — displays the current temperature as a simple red/blue LED graph.
  • 🌈 Rainbow animation — continuously cycles the colors across all 64 LEDs.
  • 💚 lucid-dreams — displays the text lucid-dreams as a scrolling message.
  • 🧬 Game of Life — runs Conway's Game of Life on the 8×8 LED matrix.
  • 🔄 Automatic looping — once the complete sequence finishes, it starts again.

Sequence

Each effect starts approximately 60 seconds after the previous effect starts:

┌──────────────────────┐
│  Temperature         │
└──────────┬───────────┘
           │ 60 sec
           ▼
┌──────────────────────┐
│  Temperature Graph   │
└──────────┬───────────┘
           │ 60 sec
           ▼
┌──────────────────────┐
│  Rainbow Animation   │
└──────────┬───────────┘
           │ 60 sec
           ▼
┌──────────────────────┐
│  "lucid-dreams"      │
└──────────┬───────────┘
           │ 60 sec
           ▼
┌──────────────────────┐
│  Game of Life        │
└──────────┬───────────┘
           │ 60 sec
           └──────────────► Repeat

Requirements

Hardware

  • Raspberry Pi
  • Raspberry Pi Sense HAT
  • microSD card with Raspberry Pi OS
  • Network connection for installing dependencies, if required

Software

  • Python 3
  • sense-hat Python library

The project uses:

from sense_hat import SenseHat

Installation

Clone the repository:

git clone https://github.com/YOUR_USERNAME/YOUR_REPOSITORY.git
cd YOUR_REPOSITORY

Install the Sense HAT library if it isn't already installed:

sudo apt update
sudo apt install sense-hat

Running

Run the program with:

python3 sense_hat_sequence.py

Or make it executable:

chmod +x sense_hat_sequence.py
./sense_hat_sequence.py

The program will continuously cycle through all five effects.

Press:

Ctrl+C

to stop the program. The Sense HAT display is cleared when the program is interrupted.

Project Structure

.
├── README.md
└── sense_hat_sequence.py

The original project consisted of separate scripts for the different effects. They have been combined into a single program to make the sequence automatic.

Effects

Temperature Display

The program reads the Sense HAT temperature and displays it as scrolling text.

Example:

T: 24.3 C

The temperature message is displayed in red.

Temperature Graph

The temperature graph represents the current temperature using the 64 LEDs of the Sense HAT.

The display uses:

  • 🔴 Red LEDs for the temperature value
  • 🔵 Blue LEDs for the remaining LEDs

The original temperature graph continuously reads the Sense HAT temperature and updates the matrix.

Rainbow

The rainbow effect uses all 64 LEDs and continuously changes their RGB values, producing an animated color transition.

The animation uses RGB values ranging from:

0 - 255

for each color channel.

lucid-dreams

The Sense HAT scrolls:

lucid-dreams

across the LED matrix in green.

This can easily be changed by editing:

sense.show_message(
    "lucid-dreams",
    text_colour=[0, 255, 0],
    scroll_speed=0.08
)

For example:

sense.show_message(
    "hello world",
    text_colour=[255, 0, 0],
    scroll_speed=0.08
)

Game of Life

The project also includes a simple implementation of Conway's Game of Life.

The world is an 8×8 grid corresponding directly to the Sense HAT's LED matrix.

Live cells are displayed in red:

red = (255, 0, 0)

while inactive cells are turned off:

black = (0, 0, 0)

The world evolves every 0.1 seconds.

Customization

The sequence can be modified directly in sense_hat_sequence.py.

For example, the duration of an effect can be changed by modifying the timing values in main().

The current sequence is designed around a 60-second interval between effects.

You can also customize:

  • Text
  • Text color
  • Scroll speed
  • Temperature display colors
  • Rainbow animation speed
  • Game of Life speed
  • Game of Life cell colors
  • Sequence order
  • Timing

Stopping the Program

The program handles Ctrl+C:

KeyboardInterrupt

and clears the Sense HAT display before exiting.

License

Choose a license for your repository before publishing the project.

For example, you can use the MIT License if you want others to freely use, modify, and redistribute the code.

Credits

Built with:

  • Python
  • Raspberry Pi
  • Raspberry Pi Sense HAT
  • Conway's Game of Life

Project: Sense HAT Display Sequence Platform: Raspberry Pi Language: Python 3 Display: 8×8 RGB LED Matrix

About

A small Raspberry Pi Sense HAT project that runs a continuous sequence of visual effects and sensor displays on the 8×8 LED matrix.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages