ButtonHero using Arduino

Summary of ButtonHero using Arduino


ButtonHero is an Arduino-based reaction game where players press buttons matching randomly lit LEDs before the light changes. Starting with 5 lives, missing a button or reacting too slowly reduces health. The project's high score is 56, and it utilizes specific electronic components wired to an Arduino board.

Parts used in the ButtonHero:

  • 4 LEDs
  • 4 pushbuttons
  • 1 Arduino (Dueilanove)
  • 4 8.2kΩ resistors
  • 4 100Ω resistors
  • 4 0.56kΩ resistors
  • wires

ButtonHero is a game made on an Arduino that involves the use of buttons, LEDs, wires, and resistors. In this game, you have to hit the corresponding button to the light that is randomly selected before the light changes. You start with 5 lives and missing or being too slow subtracts one life. The high score is 56. Good luck!

ideo of the Serial Monitor of the same game: http://screencast.com/t/PTaS3JwUu

Arduino ButtonHero

 

Step 2: Schematic

Here is the schematic for ButtonHero. The Fritzing file is also attached.

 

Step 3: The Code

Attached is the Arduino code file.

Code:
int ledDelay; // LED timeout
int score; // points you get
byte currentLed; // the one that is lit up right now
boolean started; // Are you playing the game?
boolean needNewLed = true; // we need a new LED
byte health = 6; // health remaining
boolean updateScreen=true; // do we need to update the screen?
boolean lostHealth=false; // do we need to subtract one from the health?

 

Major Components of the Project

Step 1: Supplies

Supplies include:
• 4 LEDs
• 4 pushbuttons
• 1 Arduino (we used a Dueilanove)
• 4  8.2kΩ resistors
• 4  100Ω resistors
• 4  0.56kΩ resistors
• lots of wire

For more detail: ButtonHero using Arduino

 

Quick Solutions to Questions related to ButtonHero:

  • What is the objective of the ButtonHero game?
    You must hit the corresponding button to the light that is randomly selected before the light changes.
  • How many lives does a player start with?
    You start with 5 lives.
  • When is a life subtracted from the total?
    A life is subtracted if you miss a button or are too slow.
  • What is the highest recorded score mentioned?
    The high score is 56.
  • Which specific Arduino model was used for this project?
    The project used a Dueilanove.
  • What resistor values are required for the build?
    The project requires 4 8.2kΩ resistors, 4 100Ω resistors, and 4 0.56kΩ resistors.

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter
Scroll to Top