Alex krossDawn Dupriest
Published © CC BY

Trivia Game

A fun trivia game for 2 players. The two push buttons are used as buzzers. The piezo makes a sound when one of the buttons is pressed.

BeginnerFull instructions provided1 hour892
Trivia Game

Things used in this project

Hardware components

LED (generic)
LED (generic)
×2
Resistor 330 ohm
Resistor 330 ohm
×2
SparkFun RedBoard
SparkFun RedBoard
×1
Pushbutton switch 12mm
SparkFun Pushbutton switch 12mm
×2
Buzzer
Buzzer
×1
Jumper wires (generic)
Jumper wires (generic)
×10
Resistor 10k ohm
Resistor 10k ohm
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

trivia game arduino setup

follow what it shows
File missing, please reupload.

Wiring diagram for buzzer game

Code

Triva game 2 player code

Arduino
just do it
int btn;
int btn2;
int buzzed_in = 0;
int d4 = 294;
int e4 = 330;
int c4 = 262;

void setup() {
  // put your setup code here, to run once:
  pinMode(7, INPUT);
  pinMode(8, INPUT);
  pinMode(4, OUTPUT);
  pinMode(13, OUTPUT);
  pinMode(3,OUTPUT);
  digitalWrite(4, LOW);
  digitalWrite(6, LOW);
}

void loop() {
  if(buzzed_in == 0)
  {
  // put your main code here, to run repeatedly:
  btn = digitalRead(7);
  btn2 = digitalRead(8);
  if(btn == LOW)
  {
    digitalWrite(4, HIGH);
     tone(3, d4);
     buzzed_in = 1;
  delay(500);
  noTone(3);
  delay(50);
  }

Credits

Alex kross

Alex kross

1 project • 1 follower
hi
Dawn Dupriest

Dawn Dupriest

4 projects • 5 followers
Middle School Computer Science teacher, Feminist, Maker. 2012 Poudre School District Teacher of the Year. 2016 Allen Distinguished Educator.
Thanks to Korben Eggert.

Comments