We’re glad to introduce this biiday project, take everyone in the family into building it and then have fun playing! Even the little ones enjoy this!
- Arduino Uno
- 1 Speaker (8 Ohm)
- 8 HID leds
- 5 buttons
- 1 potentiometer (10kOhm)
- Resistors to leds
The potentiometer is used to control the volume, every button is associated to two leds connected to one pin except the button that starts / selects the game.
Let’s get down to work!
|Connect the Leds:|
|Now, connect the buttons:|
|And finally, the speaker|
Connect the buttons to the anti-debounce system following this Arduino tutorial → How to debounce an input, debounce basically means that it checks twice to make sure the button is pressed.
$ bii init project
$ cd project
~/project$ bii open alopez/simon
~/project$ bii arduino:upload
And that’s it!
Just a few tips left
If you want to use debounce in a project, just write this line on the top of your main file, to reuse from the alopez’s user debounce block
To play music, reuse from the Arduino tone Library in biicode by writing into your code this:
It also reuses from this library in biicode that creates a random secuence by including:
Download biicode to start your own Simon Says game!