Your shopping cart is empty!
BBFuino Simon Says
- Idris Zainal Abidin
- 07 Feb 2014
- 518
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“.
HARDWARE
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).
SOFTWARE
SCHEMATIC DIAGRAM
There are 11 pins you need to connect to BBFuino/Arduino which are +5V, GND, D2, D3, D4, D5, D8, D9, D10, D11, D12.
PROGRAMMING HIGHLIGHT
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.
//Added to generate "more randomness" with the randomArray for the output function
randomSeed(analogRead(0));
The random function generates pseudo-random numbers.
//Assigning a random number (1-4) to the
//randomArray[y], y being the turn count
randomArray[y] = random(1, 5);
References:
http://www.instructables.com/id/Arduino-Simon-Says/
BBFuino Simon Says video: