0% found this document useful (0 votes)
5 views

Memory Game Report by Using Arduino

Uploaded by

trhrhrhtr2
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Memory Game Report by Using Arduino

Uploaded by

trhrhrhtr2
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

ELECTRICAL MEASUREMENTS (25-26)

Dr : Abdullah Hammad

STUDENTS NAME :

Abdulrahman Khalid Mohammed Assal


441805626
Mishal Mohammed AlHirsh
441802374
Hasan Nasrallah Abdulhamid Khan
441805633
Abdullah Faisal Mohammed Al Dawoud
441805033
"The aim of this experiment is to explore the potential of Arduino in
gaming applications by creating a Memory Game. As the presenter of
the report, it is important for me to clarify the main purpose of the
experiment, which is to leverage programming and engineering skills in
creating an interactive application that relies on creative thinking and
problem-solving. Additionally, I aim to identify the educational benefits
for participants, including enhancing teamwork skills and developing
fundamental engineering and programming skills.
I believe this experiment will contribute to expanding my knowledge
and skills in the fields of programming and engineering, as well as
enhancing my abilities in creative thinking and problem-solving. I will
strive to provide a detailed report that comprehensively outlines all
aspects of the experiment, starting from the components used to the
analysis of the results and my final conclusions regarding the practical
effectiveness of the experiment and its achievement of its educational
objectives."
The Arduino Uno is an open-source development board based on the
ATmega328P microcontroller. It serves as the brain for controlling the game
and executing the program stored on it. The Arduino Uno controls the
operation of lights, sounds, interacts with button inputs, and outputs the
results.
The breadboard is a prototyping board used for building electrical circuits
without the need for soldering. Electronic components such as resistors,
buttons, and LED indicators are placed on the breadboard and
interconnected using wires.

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.

Wires are used to connect electronic components on the breadboard. They


are used to connect LED indicators, buttons, resistors, and the Arduino Uno
to complete the electrical circuit necessary for operating the game.

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.

Connect the positive pin of the buzzer to Arduino


digital pin 12.
Variables used in the program, such as digital and analog inputs/outputs,
and those storing game-related data like patterns, levels, and scores, are
defined.

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.

Sub-functions may be included to organize the code and make it more


readable and maintainable, such as a function for generating patterns
and one for controlling the buzzer.

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.

Players are guided by executing the patterns displayed on the LED


indicators. For example, a player might start by pressing a button to
begin the game, then a simple pattern is displayed on the LED indicators.
The player must memorize this pattern.

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.

The process of repeating patterns and player response continues until a


certain level is reached or until the player makes a mistake in repeating
the pattern. At the end of the game, the player's score can be displayed,
such as the number of levels successfully completed and the total points
earned.
I have found that the Memory Game using Arduino is an effective way to
teach participants memory skills and enhance their ability to respond to
sequences. Through the game experience, participants can develop their
pattern-recognition skills and improve their concentration and
interaction abilities.

It became evident to me that the game experience was enjoyable and


interactive enough to capture participants' attention and keep them
engaged. I utilized sound and light elements effectively to add detail and
realism to the game experience, making it more captivating.

I can envision some future improvements in the game, such as adding


more challenging levels, enhancing the user interface to provide better
guidance to participants, and providing options for customizing the game
to suit each participant's skill level.

Based on the test results and my conclusions, I will continue to work on


the game's development and improvement based on participants'
feedback and guidance. Additionally, I am considering expanding the use
of Arduino in other gaming and educational applications to enhance
participants' educational experience further.
The code that used in this experiment is approximately 560 lines,
so I cannot put it here. Because it will take more than 10 pages.
But it's ok you can get the code from this link:

View code on GitHub

You can click on the following link to try the game using a
simulation:

view game on wokwi

Or you can use the following barcode:

You might also like