Close
0%
0%

Conway’s Game of Life on ESP32

In memory of John Conway, a simple implementation of the Game of Life on an ESP32 TTGO board.

Similar projects worth following
As were many people, I was saddened to hear about the passing of John Conway. This seemed like the perfect time to finally do something with a TTGO T-Display dev board that has been sitting in my parts box. This board has an ESP32, 135x240 LCD and a couple buttons.

The coding is a pretty straightforward implementation of the game, though I added a few things to take advantage of the hardware:
- Button 1 switches between full auto and single-step operation.
- Button 2 cycles through 3 resolutions: 135x240, 45x80, and 27x48.
- Rather then just black and white, I added color coding to indicate cells that just transitioned to alive (green) or dead (red).

Life.ino

ino - 6.97 kB - 04/19/2020 at 19:36

Download

  • 1 × LILYGO® TTGO T-Display dev board

Enjoy this project?

Share

Discussions

Martin Fasani wrote 04/24/2020 at 11:32 point

Very cool color version. I've been testing Bodmer TFT library examples and I found this monochrome version:
https://twitter.com/martinfasani/status/1253177037738651648

  Are you sure? yes | no

Don Pratt wrote 04/28/2020 at 17:35 point

Thanks.  I didn't even catch that that was in the examples.

  Are you sure? yes | no

Mike Szczys wrote 04/20/2020 at 18:19 point

I like the use of colors. Going to try something like this myself for an added dimension.

  Are you sure? yes | no

Don Pratt wrote 04/20/2020 at 22:12 point

Thanks, Mike.  I also thought about tracking how long a cell has been alive or dead and doing color gradients, but got lazy ;)  I look forward to seeing what you come up with.

  Are you sure? yes | no

Mike Szczys wrote 04/20/2020 at 22:19 point

I also got lazy. I figure it's a matter of assigning a value to each cell and decrementing it with each evolution. It would stop decrementing at 1 as 0 would be the special case for death which requires rule validation. Then the value of each cell can be the lookup table of colors. Someday I'll do the implementation :-D

  Are you sure? yes | no

Dan Maloney wrote 04/20/2020 at 16:52 point

Nice job. I added this to the Conway's Game of Life list.

  Are you sure? yes | no

Don Pratt wrote 04/20/2020 at 22:06 point

Thanks, Dan.  Seeing that list in last week's newsletter was the push I needed to finally do something with that dev board.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates