Struggling to get Jason Coon's Game of Life working

Hi all. My name is Jim and I’m located in British Columbia, Canada, and I am a John Conway’s Game of Life fanatic. I just finished building the Adafruit Make: Game of Life kits and hooked 16 kits together into one integrated unit that works awesome. With further searching on the net I came across Jason Coon’s Game of Life code for the Teensy 3.1 on GitHub that uses the Adafruit SmartMatrix Shield. At first I thought building and using the SmartMatrix Shield, the Teensy 3.1, and a 32x32 RGB LED display would be an easy “slam dunk” because I had worked with the Teensy 3.1 on an Amateur Radio Automatic Magnetic Loop Antenna Tuner project where I had no problem working with the Arduino Software, but after working through and resolving many different compiling errors I have become stuck at this compiling error: “'neighbours’was not declared in this scope”, and this line in the sketch is highlighted in red: "int count = neighbours(x, y); Any help would be much appreciated.

I am using Ardunino ver. 1.6.7 and the latest versions of Teensyduino and the SmartMatrix ver 3 libraries. My OS is Windows 10.

Thanks, Jim

Hey Jim, welcome to the SmartMatrix community! Sorry to hear you’re struggling. I’ve heard of people having a lot of issues with the latest Arduino releases, and have been holding off trying them myself. I know people are having similar issues with lots of projects, including Aurora, as documented here: Aurora compilation errors on Arduino 1.6.6 and later

If you haven’t already, you might want to try Arduino 1.6.5-r5 and Teensyduino 1.27, as documented here:

Let me know if you still have problems on those version. I hope to have time to try for myself sometime tomorrow.

Here’s a link to the code, if anyone else is interested:

It hasn’t been updated to work with the latest version of the SmartMatrix library. It’s still using SmartMatrix v2. I’ll try to find a chance to get it upgraded and tested on the latest Arduino/Teensyduino versions.

Thanks for the welcome and thanks a million Jason for replying to my holler for help! I will uninstall Arduino 1.6.7 and the latest version of Teensyduino and install the versions you have recommended. I have browsed many of the messages on this forum trying to solve my own problem without bugging you guys too much, and I was blown away with how smart and awesome the programmers who are helping out us newbies on this forum are! Like I mentioned in my first message post that I only have used the Teensy 3.1 on one previous Amateur Radio project that would automatically tune a very weird antenna that is called a Magnetic Loop Antenna, even though I had no problem with this project and I did a lot of changes to it’s Sketch file and had no compiling and loading into the Teensy 3.1 problems, my Teensy 3.1 experience is very limited and having to add so many extra Libraries to the Arduino folder is a new experience, and I’m not sure is I’m doing it properly yet. I’ll sign off here now, and uninstall all my current Arduino/Teensy software and reinstall the older versions Jason has recommended, and I’ll report back my results. Thanks, Jim VE7UV

Hi Jason, and all other group members.

I have determined that ALL of my problems getting Jason’s version of Conway’s Game of Life software to run on my Adafruit SmartMatrix Shield Version 3/Teensy3.1 combination driving a 32x32 RGB LED display were due to using my Windows 10 OS computer with the latest 1.6.7 version of Arduino, the latest Teensyduino version 1.27, and the various new version 3 Libraries required to get the SmartMatrix Game of Life to compile and load into a Teensy3.1 microcomputer.

I was FINALLY able to get “SmartMatrixLife.ino” to compile and upload into my Teensy3.1 WITHOUT crashing due to compiling errors by using with my Windows 10 OS computer Arduino version 1.64, Teensyduino version 1.24, and these Libraries: SmartMatrix_32x32-2.2.0, Time 1.5.0, FastLED 3.1.1, and Aurora 1.6 that has IR Remote Menu,

Although with the Arduino/Teensyduino and Library versions I’ve listed above seem to compile and load SmartMatirixLife.ino into my SmartMatrixShield ver 3/Teensy3.1 with no errors that crash the Arduino 1.6.4/Teensyduino 1.24 loader program and my 32x32 RGB LED display lights up brightly alternating between very colorful screens of what resemble moving and evolving cellular “organisms” and then changing to screens of solid colors where all 1024 LEDs light up with the same color, and then reverts back to the colorful screen of what resembles moving and evolving cellular “organisms”. The 32x32 RGB LED display continually alternates between just these two different screens. I will paste a copy of the compilation comments further below in this message.

This is why I think something is still very wrong and the SmartMatrixLife software is not running properly, because from what I’ve read is that when I power up my SmartMatrix Game of Life system I should get a menu that I can select options from with my Adafruit IR Remote Control and Adafruit 3 pin IR Receiver Sensor. I am not getting this IR Remote Control Menu on the 32x32 display when it is powered up. The system will only alternate between the two different screens that I have mentioned above. I get no response from any of the IR Remote Control buttons, and it’s battery is good.

I’m so close to getting this thing working properly that I can taste it :slight_smile: Any suggestion/help would be much appreciated. What would be awesome is if anyone out there has got their SmartMatrix GOL working properly with the Adafruit IR Remote Control and 3 pin IR Receiver Sensor on a 32x32 RGB LED display, could please email me a HEX version of their working software that I could load into my Teensy3.1 so that I could at least see what it looks like when properly working, I could then keep trying different things to get it working through using Libraries? If you could create such a HEX file that I could load using the Teensy Loader application program, please email it to:

Here is the copy of my last compilation comments:

In file included from SmartMatrixLife.ino:29:0:
C:\Users\JimFPV\Desktop\Arduino164\Arduino\libraries\FastLED-master/FastLED.h:12:2: warning: #warning FastLED version 3.001.001 (Not really a warning, just telling you here.) [-Wcpp]
#warning FastLED version 3.001.001 (Not really a warning, just telling you here.)
SmartMatrixLife.ino: In function ‘void randomFillWorld()’:
SmartMatrixLife.ino:137:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
Opening Teensy Loader…

Sketch uses 26,288 bytes (10%) of program storage space. Maximum is 262,144 bytes.
Global variables use 21,680 bytes (33%) of dynamic memory, leaving 43,856 bytes for local variables. Maximum is 65,536 bytes.

Thanks, Jim VE7UV

Hi Jim,

If you want the IR remote control menu, you need to compile Aurora, not just the SmartMatrixLife sketch.

No need to compile however, if you use the .hex file that’s included with the Aurora release.

Jim, I still haven’t found time to test this out. Louis is correct, the Game of Life that I implemented for SmartMatrix is completely non-interactive. It doesn’t use the remote at all. It just runs the simulation for a while, then initializes a random new world and repeats. The latest version of it includes changes from @jblang to make it less pixelated and more ‘abstract’. If you’re looking for a traditional look, you might have to try tinkering with the parameters near the top of the sketch (blur, blurAmount, randomBlur, alternateBlur, and switchPalette). I’ve added a pre-compiled hex file to the project on GitHub: Here’s video if it in action (if you haven’t seen it):

Aurora is interactive, in that it utilizes the remote, but only to choose which pattern, palette, etc. The game of life is just one pattern included with Aurora, and is effectively the same as the standalone version.

If you’re looking for an interactive version of the game of life, it looks like “Geek Mom” might have you covered:

I’m a university professor (EE) and can’t ask students using our shared lab computers to uninstall and reinstall older versions of things. I too am struggling with this. It worked great last year, but now we’re on Arduino 1.6.7 and the updated versions (current) of Smartmatrix and FastLED. I just want to be able to give the students a version of the (non-interactive) but very amazing Game of Life that Jason implemented.

We have a small budget for consulting if that helps, but I’d love to get a version of this working with current libraries.

Meanwhile, I’ll hack away…


Hi Greg,

I tried to update the sketch myself following the doc. I found a couple cases that the doc didn’t cover and updated the doc.

I committed a SmartMatrix3 compatible sketch, tested with Arduino 1.6.7, Teensyduino 1.27, and SmartMatrix3 v3.0.0.

Please let me know if it’s working for you.

If you have time, I’d love to hear more details or see a picture of people using the SmartMatrix in a classroom/lab setting.


1 Like

Thank you for replying so fast!

I did get it running with the old SmartMatrix library with Arduino 1.0.6, but again that doesn’t help my students. Thanks for the new sketch - I’ll test it out.

I teach at Stanford. One of my classes is to teach freshmen not to fear, and how to use electronics. I show them this demo (get ooh’s and ahh’s) after they have coded (for another class) GOL on a CISC machine. They are amazed at what the little ARM can do at 100-ish MIPS.

This community (you, Jason, et al.) are absolutely awesome. Any are welcome if you are in the area (Bay Area).



Greg, that sounds amazing!

I just merged Louis’ changes to my original repo and tested them on Arduino 1.6.8 (the latest version currently) with Teensyduino 1.28-beta1.

Greg, thanks for the invite! My wife and I used to live in Menlo Park and she got her PhD (Biology) from Stanford. We’re in NYC now, but hopefully I’ll get a chance to head back sometime.

@Jim_VE7UV and @GregK,

I just published a branch adding infrared remote controls to the Game of Life simulator:

It supports the Adafruit, SparkFun, and SmartMatrix remotes. It supports controlling speed, power, brightness, palette, clearing, randomly filling the world, pausing, and “drawing”.

If you don’t have the full SmartMatrix display or bundle, you can use an infrared receiver diode like this one from SparkFun. Just connect power, ground, and the receiver pin. I used pin 18, but you can change it on line 32. Here are some connection instructions.

Let me know if you have any questions, comments, suggestions, etc.

@GregK, have you tried removing the delay at the end of the loop? If your students were impressed with the ARM processor before, they should really see it at full speed. :smile:

I deleted the pixelmatix/SmartMatrixLife repo to avoid confusion, Jason’s original repo is where to go for the latest changes