Skip to content

duphlot/HD1_GameBamNut

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lê Hồng Phong Science Club - Button Game

Infomation

The inspiration for the Button Game stems from the "Simon game," a classic toy featuring seven buttons and lights. Powered solely by a portable charger and an Arduino Uno board, our game challenges players to memorize and replicate a randomly generated sequence of illuminated buttons.

At the 2022 Vươn Lên Camp of Le Hong Phong High School for the Gifted, our club showcased this project to welcome incoming 10th graders. Through this interactive and memory-challenging game, we aimed to ignite students' passion for programming while demonstrating the creative potential of our club members.

How it works

The game consists of 3 rounds:

  • Round 1: One light is turned on at a time(a total of 7 times).
    • Step 1: Randomly generate a sequence of 7 unique numbers using a marked array.
    • Step 2: Following the randomized sequence, turn on the lights one by one and check if the correct button is pressed. If incorrect, the player loses; otherwise, continue. (Checking method: Use a for loop to check each button to see if it's currently lit. Since the checking time for one button is less than 0.0000006s and the average button response time is 0.3s, the check will always be accurate.)

alt text

  • Round 2: Two lights are turned on at a time (a total of 3 times).

    • Step 1: Randomly generate a sequence of 7 unique numbers using a marked array.
    • Step 2: Following the randomized sequence, turn on two lights at a time and check if the correct two buttons are pressed. If incorrect, the player loses; otherwise, continue. (Checking method: Use a for loop to check each button to see if it's one of the two lit lights. If so, continue checking for 0.1s to see if the other lit button is pressed. If not, the game is over.)
  • Round 3: Randomly turn on 1 or 2 lights(the number of times turned on depends on the machine's random combination).

    • Step 1: Randomly generate a sequence of 7 unique numbers using a marked array.
    • Step 2: Randomly generate a light combination. If it's 1 light, check as in Round 1; if it's 2 lights, check as in Round 2.

Components

Product's name Quantity Unit price Total
Arduino Uno 1 210.000 VNĐ 210.000 VNĐ
Nút bấm 12mm 2 7.500 VNĐ 15.000 VNĐ
Vỏ nút bấm 2 5.000 VNĐ 10.000 VNĐ
Còi chip 1 4.000 VNĐ 4.000 VNĐ
Led tím 1 4.000 VNĐ 4.000 VNĐ
Led vàng 1 3.500 VNĐ 3.500 VNĐ
Led xanh lá 1 3.500 VNĐ 3.500 VNĐ
Led xanh dương 1 3.500 VNĐ 3.500 VNĐ
Led đỏ 1 3.500 VNĐ 3.500 VNĐ
Led hồng 1 5.000 VNĐ 5.000 VNĐ
Led trắng 1 3.500 VNĐ 3.500 VNĐ
Băng keo 2 mặt 1 6.000 VNĐ 6.000 VNĐ

INSIDE

alt text

About

LHP_Vươn Lên 2022 - 2023

Topics

Resources

Stars

7 stars

Watchers

1 watching

Forks

Contributors

Languages