/pico-conway

Conway's game of life on a pico

Primary LanguageC++MIT LicenseMIT

pico-conway

Cellular automata on a pico...

./pico-conway.png

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.

build

hardware

Uses the Rasbperry Pi pico with the Pimoroni pico-display-2

software

Requires pico-sdk and the pimoroni-pico](https://github.com/pimoroni/pimoroni-pico) libraries.

  1. fork or clone this repo.

  2. download and extract a release of the pico C/C++ SDK

  3. symlink it into the repo root as pico-sdk, e.g. ln -s ../pico-sdk-1.5.1 pico-sdk.

  4. symlink the cmake import: ln -s pico-sdk/external/pico_sdk_import.cmake

  5. download and extract a release of pimoroni-pico. This is needed for the graphics library and display driver.

  6. symlink it in the repo root as pimoroni-pico, e.g. ln -s ../pimoroni-pico-1.21.0 pimoroni-pico

  7. build the image with

    mkdir -p build
    cd build
    cmake ..
    make -j
  8. copy image to device (connected with BOOTSEL pressed), e.g.

    cp pico-conway.uf2 /media/<username>/RPI-RP2

test

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