Memory Game Report by Using Arduino
Memory Game Report by Using Arduino
Dr : Abdullah Hammad
STUDENTS NAME :
Resistors are used to limit the flow of electric current and protect against
excessive current. In this experiment, resistors with a value of 220 ohms can
be used to control the current to the LED lights and protect against potential
damage.
Push buttons are used as control buttons in the game. When a button is
pressed, a signal is sent to the Arduino Uno indicating the button press,
triggering a specific action in the program.
LED indicators are used to display lights in the game, such as showing the
sequence of colors in the Memory Game. The Arduino Uno controls the
turning on and off of the LED indicators based on signals received from the
game program.
The buzzer makes sounds in the game, like beeps or alerts. It's controlled by
the Arduino Uno, connected to a specific port, and programmed to make
sounds when needed. These sounds add fun and realism to the game,
making it more enjoyable for players.
connect the negative pins of the pushbuttons into
Arduino digital pins 2, 3, 4, and 5.
Connect the anodes (longer legs) of LEDs to Arduino
digital pins 7, 8, 9, and 10 through 220Ω resistors.
The setup function initializes digital and analog inputs/outputs and any
necessary variables before starting the game.
The loop function executes the core functions of the game, such as
displaying patterns to the user, responding to pressed buttons, and
controlling sound and light outputs based on inputs.
The code should include mechanisms for interacting with the user, such
as displaying patterns and responding to pressed buttons in line with the
game context.
Sound and light outputs are controlled based on the current game state
and user interaction, like emitting different sounds when buttons are
pressed or activating lights in a specific pattern.
In the Memory Game, the color sequence displayed to the user and
testing their ability to recall it should be defined. This part is specifically
implemented by determining specific color patterns, displaying them,
and testing the user's response.
The game is simply started by connecting the Arduino Uno to a power
source and powering up the program loaded onto it. Upon starting the
game, the Arduino Uno activates the breadboard and other components,
allowing the game to begin.
After displaying the pattern, the program pauses for a while to allow the
player to remember the pattern. The player then repeats the displayed
pattern by pressing the appropriate buttons in the correct sequence.
Once the player repeats the pattern, their answer is compared to the
correct pattern displayed. If the answer is correct, the game plays specific
sounds for confirmation and moves the player to the next pattern level. In
case of a wrong answer, other sounds indicating the mistake are played,
and the pattern is displayed again for the player to try again.
You can click on the following link to try the game using a
simulation: