Follow me on Instagram for more projects! @neyth_makes
This is a C++ apllication that runs various cellular automata and retro games on a raspberry Pi and an LED matrix. It can be controlled using a controller, I have used a PS4, and Nintendo Switch Pro controller successfully. Consider this a pre alpha version, install and play around with it if you are interested, but it doesn't function as a finished product yet. This requires a raspberry Pi, I have tested on the Pi 4 and a headless Pi zero. The Pi 4 works flawlessly, the Pi zero works alright for some of the cellular automata, but the games are too laggy to play. This was written for a 64x64 matrix, but have also tried most of it on a 32x64 matrix. This isnt officially supported right now and requires editing the code but try it if you like. It can also interface with an iPad companion app I wrote, the code for this is in the networking folder. The iPad app allows you to paint individual pixels and communicates these over a local network to the matrix.
- Snake, one and two player
- Tetris
- Space Invaders
- Conway's game of life
- Rule 30
- Langton's ant
- Langton's loop
- Raspberry Pi, preferably better than a Pi zero. Tested oon Pi3A, Pi4 and Pi0. All work although the 0 is quite laggy
- LED matrix, 64x64 is currently the only supported size
- A Nintendo Switch Pro controller, PS4 controller or it also works with one of these cheaper controllers
- (recommended) matrix hat or bonnet, so you don't have to wire it to the GPIO pins yourself
- (optional) 3D printer to print the case
- (optional) 5v fan to prevent overheating in the case
If you don't need to recompile follow these steps, if you do follow these and the ones below first install git and libevdev:
sudo apt-get update
sudo apt-get install git
sudo apt-get install -y libevdev-tools
then create a directory and inside that directory run
git clone https://github.com/zcqsntr/retro_matrix --recursive
If the application doesn't run after you've done this try the steps below.
If you need to recompile for any reason then you need to setup libevdev first:
sudo apt-get install autoconf
sudo apt-get install libtool
cd libevdev
./autogen.sh
./configure
make
make install
Then run my setup script which compiles everything and runs a command on the excecutable to reduce flickering.
cd ..
./setup
Then to run the application you need to run (from the root retro_matrix directory), do not use sudo!
./run_retro_matrix <args>
where args are the arguments required to get the rgb-rpi demos working, e.g. I use on a Pi3 and Pi4
./run_retro_matrix --led-slowdown-gpio=4 --led-gpio-mapping=adafruit-hat
You should get some console output, and a start screen.
You need either a controller or a keyboard connected to run, not all controllers are supported but all keyboards should work.
To start the application press the start button (esc on keyboard), if start doesn't work try pressing random buttons as the input mapping might be slightly different on different controllers.
The controller button mappings are standard. For the keyboard, directions are w,a,s,d. Space is select (the A button on controller) and j,k,l are the remaining face buttons, with l being back (the B button on controller).
If anything doesn't work let me know and I'll try and fix it
- libevdev
- pip install pytz and pip install apds9960 (for weather)