Cellular automata on a pico...
Cells are colour-coded according to their age. Button A resets, B clears the screen, X adds a randomly-placed glider (this happens randomly without pressing anything). Y toggles screen brightness.
Uses the Rasbperry Pi pico with the Pimoroni pico-display-2
Requires pico-sdk and the pimoroni-pico](https://github.com/pimoroni/pimoroni-pico) libraries.
-
fork or clone this repo.
-
download and extract a release of the pico C/C++ SDK
-
symlink it into the repo root as
pico-sdk
, e.g.ln -s ../pico-sdk-1.5.1 pico-sdk
. -
symlink the cmake import:
ln -s pico-sdk/external/pico_sdk_import.cmake
-
download and extract a release of pimoroni-pico. This is needed for the graphics library and display driver.
-
symlink it in the repo root as
pimoroni-pico
, e.g.ln -s ../pimoroni-pico-1.21.0 pimoroni-pico
-
build the image with
mkdir -p build cd build cmake .. make -j
-
copy image to device (connected with
BOOTSEL
pressed), e.g.cp pico-conway.uf2 /media/<username>/RPI-RP2
The algorithm itself can be tested/debugged on the host machine using the test harness, e.g.:
g++ -g -O0 -Wall -Werror --std=c++20 src/test_conway.cpp src/conway.cpp -o test