Wednesday, July 24, 2019

Simon Game Clone with Circuit Playground Express and CircuitPython

In this guide, you will learn how to write a cute and fun little game for the Circuit Playground Express board, using the CircuitPython language. The game is a clone of Simon, a once very popular game of memory in which you have to remember a sequence of colors and sounds that gets progressively longer. This game was an instant hit when it was released in 1978 and became a pop culture symbol of the 1970s and 1980s.

In case you have never heard of Simon before, below you can see the original game console in all its splendor:

My version of this game for the Circuit Playground Express uses several of the features of this board:

  • The ten NeoPixel RGB LEDs are split in groups to represent the four colored areas
  • The speaker plays tones that approximate those of the original game console
  • The capacitive touch inputs are used for the player to enter the sequence

To write this game, I used a software technique called bottom-up development. The basic idea is to take a complex project and break it up into smaller and simpler tasks. You begin by implementing the smaller tasks and then work your way up to the bigger ones, which are now less complex because they can rely on the lower level tasks that are already implemented. This way of tackling a software task is good for many types of projects, but is particularly well suited for games. I hope once you learn it you will be able to apply to your own projects!

Parts

This is an easy, no solder project. All you need is an Adafruit Circuit Playground Express board and a known good USB A to microB cable containing both power and data wires. Do not use the stubby USB cables that come with cell phone charging batteries, most do not have the data wires!

No comments:

Post a Comment