LED Roulette

Originally published at: LED Roulette – BrainPad

How it works

LED Roulette is a two-player game, that is created using the BrainPad, and modules found inside the BrainClip Kit.

The object is for each player to try and stop the spinning LED when it reaches their side by pressing their button. First player to 5 wins.

Hardware

The BrainPad Pulse is shown in the example but any BrainPad hardware with a screen can be used depending on the pin connected.

We’ll also need 2 buttons and the LED Ring modules.

In our example we’re going to attach the modules to an enclosure. You can use or create any type of enclosure you wish. In fact you can create the game with just a BrainPad and the components themselves.

If you’re going to be using an enclosure the first thing we need to do is measure the components so we know where to place the holes on our enclosure.

Next mark the position of the holes on the enclosure where we’ll be placing the BrainPad and each of the modules.

Drill holes where we marked our enclosure.

We’ll need 36 metal stands-offs. First attach stand-offs to the BrainPad and each module.

Place the BrainPad and each module into the holes we drilled on the enclosure.

Flip the enclosure over and use the remaining stand-offs to secure the components.

Use the wiring diagram below to attach wires to the stand-offs on on the bottom of our enclosure. Each components is labelled on the top, so you may have to flip back and forth to ensure you’re connecting to the correct stand-off.

It may look like a mess, but each alligator clip is connected to our BrainPad. In the case of the GND pad you should have 3 alligator clips connecting each component to GND stand-off on the BrainPad. Ensure that none of the other alligator clips are touching each other or more than one stand-off.

Once we’re confident in our wiring we can attach any back panel we have for our enclosure. Be sure not to pinch any of the alligator clips when closing.

Once the construction is complete, we’re ready to add some code to create our game.

The Code

The code for this was done using MakeCode and is available on the BrainPad MakeCode site found under the section titled Showcase Projects.