Go Down

Topic: Help on trivia game project (Read 413 times) previous topic - next topic

Serow

Hello. I am doing a trivia game project for school and need some guidance on what would be best to do for code. The game will work like this: Two players will each be listening to an audio recording that asks A, B, C or D questions. They each will have buttons in front of them that correspond to ABC and D. When they think they know the answer they will push the corresponding button. Pushing the button will lock the other person out. If it is correct it will add 1 to the persons score and go to the next question. If it is wrong it will just go to the next question. I am not sure how I will show the score.

I need some ideas on how to do the code. How should I store and check the answers? How do I check to see which button is pushed and compare that to the answeres?
Thanks!

HazardsMind

#1
Jan 27, 2014, 06:24 pm Last Edit: Jan 27, 2014, 06:39 pm by HazardsMind Reason: 1
Will the audio recording be on an MP3 shield or outside unit?

Quote
Pushing the button will lock the other person out.
Is this just one panel or individual panels? Never mind

Quote
If it is correct it will add 1 to the persons score and go to the next question. If it is wrong it will just go to the next question. I am not sure how I will show the score.
This is  really straight forward. Will you be using an LCD display, 7 Segment display, or Serial monitor?

Quote
How should I store and check the answers?
If you use and MP3 Shield, you can use an array to store the track number and correct answer letter/button/pin whatever. If you use an outside unit, then you will need to make sure the correct track is played in order to match it with the correct answer.
My GitHub:
https://github.com/AndrewMascolo?tab=repositories

Serow

The audio will be seperate. It will just be played on an MP3 player. The players will just keep track. I'm planning on using servos as pointers to represent the score.

HazardsMind

Quote
I'm planning on using servos as pointers to represent the score.
?
Why not use a LCD display of some kind?
My GitHub:
https://github.com/AndrewMascolo?tab=repositories

Serow

I don't have an LCD already, but I do have servos. I don't want to buy anything extra.

HazardsMind

Quote
I don't have an LCD already,
Ok fine.

The Arduino software has button examples you can play around with, and there are also plenty of other button libraries in the Arduino Playground that you can try.
Same with your servos.

Waiting for a player to press a button and lockout the other player is a little tricky, but we'll get to that later. Right now the best thing you can do is find examples, play with them, learn from them and make your own code. If you have any issues, let us know, but to get help, you must present a code with comments and put some effort into it.
My GitHub:
https://github.com/AndrewMascolo?tab=repositories

mirith

Do you have any idea on how the MP3 Player will interact with the arduino?  Have you worked that out already?

Otherwise you'll need to hack it to get at the information somehow, so you can sync the Arduino with the MP3 Player.

Serow

Quote
Right now the best thing you can do is find examples, play with them, learn from them and make your own code. If you have any issues, let us know, but to get help, you must present a code with comments and put some effort into it.

Sound good. I realize I can't rely on people on the forum to just write the code for me. I'll go play with the examples and come back to the code forum when I have something a little more concrete.
Quote

Do you have any idea on how the MP3 Player will interact with the arduino?  Have you worked that out already?

Otherwise you'll need to hack it to get at the information somehow, so you can sync the Arduino with the MP3 Player.

The arduino won't interact with the MP3 player at all. I am making a recording that asks a question and gives ABC or D answers. The correct answer to each question will be stored on the Arduino. The game will rely on the people being on the right question.

mirith

As long as you understand that the timing will need to be pretty exact, and you'll probably want an RTC module (Unless you are only building one, then you can just do lots of timing tests and calibrate it, but then you'd have to do the same to any others you built).   While the Arduino's timing can work decently, I do not consider it to be the most reliable clock (In terms of a wall clock), in the world.  I imagine over time it will lose or gain seconds, and that could throw off your game.  Make sure to do lots of testing on this that after 20 questions, the "start" points still line up.  Making sure all of the questions are the same length will probably help too, even if that means adding dead time to them all.

Zarnookie

What about doing the two player boxes plus a host box.  You could then input the answer at the start before the players can buzz in.   Like a combined reset button.  This would allow you to use any test you wanted or just change the order of the same questions without having to reprogram.   And you can keep score easily this way too.  The only downside I can think of would be you'd have to block the player from seeing you input the answer.  But that could be done with a book or something.   As for programming I'm new too arduino myself so no help there.

Go Up