Simulating Conways game of life on the sense HAT add-on for the raspberrypi
View Demo
·
Report Bug
·
Request Feature
Table of Contents
This project is about a Game of Life Simulation with SenseHat on Raspberrypi. The more sensores i discovered on the modul the more i wanted to use them and so i did. Also i thougth it would be a good idea to start with learning to use multithreading but as you can see i couldnt go in verry deep.
Before you start you need to connect the raspberry pi to the internet and install the Sense HAT module.
if you dont have git install it with this command
sudo apt install git
- Clone the repo
git clone https://github.com/Fett-Mops/Game-Of-Live-SenseHat/
- Install sense-hat
pip install -r requirements
heres how to run the programm
python3 GoL.pyby default the colors of the LED's are grey but if you dont like that you can use a predefined color like this
python3 GoL.py -b-r 🟥 -b 🟦 -g 🟩 -y 🟨 -p 🟪 -w ⬜ -o 🟧 -b 🟫 -gr ⬜ -rand 🌈
ok so you start in the Home menue. if you shake the raspi hard it randamizes the hole grid. now you can press the joistick to start simulation. press again to pause. if you want to reset the grid put the raspi on his had wait a bit and all the leds should be dead. if you press long you can go to home mode here or in pause mode you can enter with up prebuild mode here you can choose between diffrent prebuild shapes to simulate. with right you enter custom gird mode where you can move a curser wich is blinking in red and inverts the pixel underneth if you push the joistick in. to leav this mode you have to hold in the middle the joistick to go in home mode again in wich you can with a simple push simulate your grid. if you push left or down you get to the secred noted below.
In the secrete i would have done a rick roll yet it is very hard to recognize without the audio on a 8x8 display (it plays the audio if your earphones are connected) thats why i decidet to use the Bad Apple as an alternative. it is more recognizable because of the contrast( the whole video is black&white). Also i recomend to put a paper above the display because it blends the LED's thogether. here if you want to use "Never Gonna Give You Up" by Rick Astley you have to push the joistick down in the pause or home mode but if you push left it will play "Bad Apple" form ZUN.
if there is someone who really wants to have there own video implemented write an issue or contact me in another way. I know how to implement that but i didnt fellt the need because i already have all the options i could wish for :) or you can do it yourself by modifying the code and convert a mp4 to frames via vid_to_frames.py.
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
