Go Down

Topic: quick beginners project - Quiz Game Lock-out controllers (Read 2214 times) previous topic - next topic

childofthehorn

This project was literally done in less time than it took to put this post together. Program, circuit, reverse engineering and building took about 2 hours while watching comedy shows so it should take less than that!
No Dremel or real electrical knowledge required. LCD is there because I have it pretty much attached to the board. For more projects like this, my personal blog is DoesitPew.blogspot.com

I made this for a class that my boyfriend was teaching at Northwestern for mostly kids in the Chicago Public School system about GAME SHOWS! We wanted to have the kids play plenty of them so that they can win cash (we had about $500 we were ready to give away) or Fabulous funny Prizes from the Dollar Store for just participating like the item below or books like "Fails to Meet Expectations" all in good fun. If you would like digital copies of the games we played (all programmed by Stev-o of Stev-o.us) which can be made with any questions or prizes listed on the screen just like the originals (Assasin, Survey Says, Lucky Roller, Joker's Crazy Slots, etc. *names changed due to licencing*) please contact Stev-o at Stev-o.us and they must be used for non-profit or family fun!

Back to the controller...

Parts:
- BreadBoard
- Precut Wire package
- 4 long pieces of 2 Channel Wire ( I used old cut up headphone cables)
- 4 resistors of anywhere from 10k-100k value will work
- 4 resistors of 3k-10k depending on brightness desired
- 4 LEDs you have laying around
- One Arduino Board or MSP430 using EasyMSP
- 4 EasyButtons from Staples (can also use push lamps from the dollar store)
- Computer with USB (program also spits back out which player clicked in first).

Cost ranges from $20 - 50 depending on what you have on hand. I had all of this at home and most other parts can be bought at RadioShack or even Ace Hardware or all pieces from Adafruit or Sparkfun.

Circuits


Inside of the EasyButton


Wire Hookups

*Now just screw it back together and be careful about the capacitor discharge, so be sure to plug it in with the capacitor line not being connected to the + voltage.*

Pictures of the Working Item!


Download the software:
http://www.sendspace.com/file/4mpr2y

You can Add a buzzer using the tone command and one of the free PWM pins, but I didn't just because of the noise level in the room would have made it not loud enough. Use an old headphone speaker or good one out of a broken pair. Reseting the system is just using the RESET pin on the Arduino Board. Please do not mind the quick and dirty code format.....it didn't have to be perfect, just work!
Code: [Select]
/*
  EasyButton Game Controller

  This code is used to make your own buzzer control for your own at home games

  Microcontroller used is an Arduino core on an ATMega (can be used with EASYMSP code as well with minor translation)
 
  Program does give preferance to player by number, but if two people manage to press at the same time within less
  than a microsecond, I say give it to them!
  This is completly Open Source Code and Open Source Hardware
  Property of StacyD at doesitpew.blogspot.com 2011

  Schematic also available at Doesitpew.Blogspot.com
*/


//Define the Buttons

//button input pins (digital)
int b1 = 9;
int b2 = 8;
int b3 = 7;
int b4 = 6;

//button status
int bu1 = 0;
int bu2 = 0;
int bu3 = 0;
int bu4 = 0;

//led outout pins(digital)
int l1 = 5;
int l2 = 4;
int l3 = 3;
int l4 = 2;

//Status of whether or not a button has been pressed
int hold = 0;


void setup() {               
  //allows you to see on a computer who buzzed in first
  Serial.begin(9600);
 
//Lockout Status LED pin with is statndard on the Arduino Board(s)
  pinMode(13, OUTPUT);
 
  //Button inputs defined
  pinMode(b1, INPUT);
  pinMode(b2, INPUT);
  pinMode(b3, INPUT);
  pinMode(b4, INPUT);
 
  //LED outout Pins defined
  pinMode(l1, OUTPUT);
  pinMode(l2, OUTPUT);
  pinMode(l3, OUTPUT);
  pinMode(l4, OUTPUT);
 
  //The delay allows time for the voltage to stabilize (exp. because the electronics are not removed from the buttons!)
  delay(1000);
}

void loop() {
 
  //Read to see if a button is pushed
  if(hold == 0){
    bu1 = digitalRead(b1);
    bu2 = digitalRead(b2);
    bu3 = digitalRead(b3);
    bu4 = digitalRead(b4);
 
  //If the status of any of the Buttons has changed to being pulled low
  //lockout the other users and light up the appropriate button
   
    //player 1
    if(bu1 == 0){
      digitalWrite(l1, HIGH);
      hold = 1; //lockout the other users
      Serial.println("Player 1");
    }
    //player 2
    if(bu2 == 0){
      digitalWrite(l2, HIGH);
      hold = 1; //lockout the other users
      Serial.println("Player 2");
    }
    //player 3
    if(bu3 == 0){
      digitalWrite(l3, HIGH);
      hold = 1; //lockout the other users
      Serial.println("Player 3");
    }
    //player 4
    if(bu4 == 0){
      digitalWrite(l4, HIGH);
      hold = 1; //lockout the other users
      Serial.println("Player 4");
    }
  }
  else{
    digitalWrite(13, HIGH);   // set the LED on to indicate that the other users are locked out
  }
}

[/size]

Si

--
My New Arduino Book: http://www.arduinobook.com

Sir,,does it also work with different switches?  because we dont have any available easy buttons here ..:D...thanks for the code...:D

Go Up