Introduction: Simon Says

This instructable is written in Dutch.

Voor onze seminar 'Happy Hacking' op de HKU hebben wij een soundboard gemaakt die is gebaseerd op het spel Simon says. Door op een button te drukken komt er een geluid uit. Elke button heeft een eigen geluid. Ons Simon says bord komt te hangen bij de bushaltes om tijd te rekken. In plaats van dat je op de telefoon scrolt of saai zit te wachten, kan je een leuk simpel spelletje spelen.

Step 1: Materialen

- A0 formaat poster

- Houten bord

- Houten plank (de cirkels van de buttons te maken)

- Verf in de kleuren rood, geel, blauw, groen en wit

- Kwasten - Poster printer

- Editing programma (wij gebruikten Adobe Illustrator)

- Arduino

- Lijm

- Boor

- Zaagtafel

- Audiobox

- 4x knoppen

- MP3 shield

- Micro SD kaart

- Powerbank

- AUX audio kabel

Step 2: Het Maken Van Het Bord

Koop een houten bord van A0 formaat of groter.

Op Adobe Illustrator design je het logo, wat op het bord vast kom te zitten.

Vervolgens sla je dat op als een groot PDF formaat en print je het uit op A0 poster formaat.

Met lijm maak je de poster vast op het bord.

In het bord boor je acht kleine gaatjes, daar komen de draadjes in van de knoppen (2 draadjes per knop).

Voor de knoppen maken wij houten buttons uit een plank.

Maak vier cirkels met een diameter van 5 cm in de plank en zaag ze vervolgens uit.

In de houten cirkels maak je kleine gaten waar de bovenkant van de knop in past.

De houten buttons schilder je eerst wit.

Waneer ze gedroogd zijn ga je er met een laag kleur overheen.

Totaal krijg je dan vier buttons in de kleuren rood, blauw, geel en groen.

De buttons druk je in de knoppen zodat ze vast zitten in het bord.

Op de achterkant van het bord tape je de Arduino, speaker en powerbank vast.

Step 3: Programmeren

Maak de bovenstaande setup na op je Arduino.

Voer vervolgens deze codes in: (De SD moet met fat geformatteerd zijn en de nummers Track001 tot Track 004 heten.) #include //Add the SdFat Libraries #include //#include //and the MP3 Shield Library #include // Below is not needed if interrupt driven. Safe to remove if not using. #if defined(USE_MP3_REFILL_MEANS) && USE_MP3_REFILL_MEANS == USE_MP3_Timer1 #include #elif defined(USE_MP3_REFILL_MEANS) && USE_MP3_REFILL_MEANS == USE_MP3_SimpleTimer #include #endif /** * \brief Object instancing the SdFat library. * * principal object for handling all SdCard functions. */ SdFat sd; /** * \brief Object instancing the SFEMP3Shield library. * * principal object for handling all the attributes, members and functions for the library. */ SFEMP3Shield MP3player; int buttons[] = {2,3,4,5}; //------------------------------------------------------------------------------ /** * \brief Setup the Arduino Chip's feature for our use. * * After Arduino's kernel has booted initialize basic features for this * application, such as Serial port and MP3player objects with .begin. * Along with displaying the Help Menu. * * \note returned Error codes are typically passed up from MP3player. * Whicn in turns creates and initializes the SdCard objects. * * \see * \ref Error_Codes */ void setup() { uint8_t result; //result code from some function as to be tested at later time. Serial.begin(115200); //Initialize the SdCard. if(!sd.begin(SD_SEL, SPI_FULL_SPEED)) sd.initErrorHalt(); // depending upon your SdCard environment, SPI_HAVE_SPEED may work better. if(!sd.chdir("/")) sd.errorHalt("sd.chdir"); //Initialize the MP3 Player Shield result = MP3player.begin(); //check result, see readme for error codes. #if defined(__BIOFEEDBACK_MEGA__) // or other reasons, of your choosing. // Typically not used by most shields, hence commented out. Serial.println(F("Applying ADMixer patch.")); if(MP3player.ADMixerLoad("admxster.053") == 0) { Serial.println(F("Setting ADMixer Volume.")); MP3player.ADMixerVol(-3); } #endif for(int i = 2; i < 6; i++) { pinMode(i,INPUT_PULLUP); } Serial.println("Start"); } void loop() { // Below is only needed if not interrupt driven. Safe to remove if not using. #if defined(USE_MP3_REFILL_MEANS) \ && ( (USE_MP3_REFILL_MEANS == USE_MP3_SimpleTimer) \ || (USE_MP3_REFILL_MEANS == USE_MP3_Polled) ) MP3player.available(); #endif int b = digitalRead(buttons[0]); if(b == LOW) { MP3player.stopTrack(); MP3player.playTrack(1); } b = digitalRead(buttons[1]); if(b == LOW) { MP3player.stopTrack(); MP3player.playTrack(2); } b = digitalRead(buttons[2]); if(b == LOW) { MP3player.stopTrack(); MP3player.playTrack(3); } b = digitalRead(buttons[3]); if(b == LOW) { MP3player.stopTrack(); MP3player.playTrack(4); } }