Ever heard “Simon Says” game? For those who not familiar with Simon, this was an early electronics game from the 70’s, where the user basically had to repeat back a sequence to the console to progress to the next level. This is example of electronic Simon Says DIY kit. Now we want to play it using BBFuino. In this tutorial, we will show you how to create a simple Simon Says game on the breadboard.
*If you are new in BBFuino, maybe you need to start from here “Getting Started with Arduino – BBFuino“.
1. BBFUINO (link).
2. UC00A – Programmer (link).
3. USB Mini Cable – Programmer (link).
4. Breadboard (link).
5. Button LED (green, blue, red).
6. Piezo Transducer (link).
7. Jumper Wire (link).
8. 12V Adapter (link).
There have 11 pins you need to connect to BBFuino/Arduino which are +5V, GND, D2, D3, D4, D5, D8, D9, D10, D11, D12.
In order to make “more randomness” in giving a sequence in Simon Says game, randomSeed function is used. randomSeed() initializes the pseudo-random number generator, causing it to start at an arbitrary point in its random sequence. If it is important for a sequence of values generated by random() to differ, on subsequent executions of a sketch, use randomSeed() to initialize the random number generator with a fairly random input, such as analogRead() on an unconnected pin.
[code lang=”c” highlight=”yes”] //Added to generate "more randomness" with the randomArray for the output function randomSeed(analogRead(0)); [/code]
The random function generates pseudo-random numbers.
[code lang=”c” highlight=””] //Assigning a random number (1-4) to the //randomArray[y], y being the turn count randomArray[y] = random(1, 5); [/code]
BBFuino Simon Says video:
BBFuino Simon Says source code (download).
*Credit to Robert Spann & Digimike.
**There have two folder, 1st folder contain main file (BBFuinoSimonSays.ino) and 2nd folder is library (ToneLibrary.zip). You need to import the library using Arduino IDE (Sketch > Import Library > Add Library > ToneLibrary.zip). For more detail, you can refer “Installing Additional Arduino Libraries“.