Giter Site home page Giter Site logo

simon-game-raspberry-pico's Introduction

Simon-game-Raspberry-Pico

Simon game on Raspberry pi Pico

How to play Simon game

The classic Simon game is a circular object that has four colored quadrants. Each quadrant has a colored surface, which is a switch that also illuminates.

Simon game image

The quadrant colors are green, red, yellow, and blue. You start by pressing a button, after which one of the quadrants flashes its light. It also plays a tone, with a unique sound for every quadrant. The object of the game is to remember which light flashed, and then repeat it. If you succeed, then the game starts again, this time flashing the first light as well as a second one. Again, the object is to repeat the sequence. As long as you successfully repeat the sequence, the game continues, flashing more lights and having you repeat them. It also gets faster as you get to higher levels. If you fail, however, you are greeted with a disapproving tone, and you need to start again from scratch.

Building Simon

We will construct our version of Simon using LEDs, and some pushbuttons. The “brains” of our game is the Raspberry Pi Pico microcontroller, a 4-dollar technical wonder. And we’ll be programming it using C and state machine instead of the traditional Python.

Parts Required

Here is what you’ll need to construct a Simon game:

  • A Raspberry Pi Pico microcontroller. You’ll also want to solder the pins onto the microcontroller, so you’ll need 2 20-pin male Dupont terminals.
  • Four colored LEDs. I suggest you emulate the original Simon by using a Green, Red, Yellow, and Blue LED.
  • Four Dropping resistors. Any value from 100 to 220 ohms will work, I used four 120-ohm resistors in my game.
  • Four Pushbutton switches. These need to be momentary contact, normally open switches. If you can get ones with colored tops to match your LEDs, that would be great, otherwise, any color will suffice.

Simon game image

Build the pico firmware

This project has a github actions workflow that build the Pico firmware.

Othewise the project can be build with the following commmand, the cmake may take a couple of minutes.

mkdir build 
cd build
cmake ..
make -j6

flash the RaspberryPi Pico

Drag and drop the src/simon.uf2 on the Pico in bootsel mode, or use the following command:

cp src/simon.uf2 /media/<user>/RPI-RP2/

simon-game-raspberry-pico's People

Contributors

behloulmedamine avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.