Question: Hit the Objective: To create a video game using a piezo buzzer ( speaker ) , an OLED I 2 C display and a joystick

Hit the
Objective:
To create a video game using a piezo buzzer (speaker), an OLED I2C
display and a joystick with a pushbutton all connected to a microcontroller.
In this game the user will see an "x" appear somewhere at random on the
screen. They will then use the joystick to move a second character on the
screen (such as a "0") until it covers the x symbol, and push the button. If
the location of both characters is the same, the x then re-appears at another
random location and the game continues. After 10x's the game ends and
the user is given a score showing how much time it took him to get 10 "hits".
Details:
When the game starts there should be an introduction shown on the screen,
and a short tune will play on the speaker. After this the games starts as
described earlier. If the user pushes the button and misses, a short tone
should play. If he "hits the x", a short little tune should play and he gets a
message on the screen such as "you hit it!. Then the x re-appears in a
different random place and the game continues. After 10x's the game ends,
and the total time it took the user to get ten hits will be shown as a score.
After this the game restarts.
Hints:
-To keep track of the time it took to hit ten x's (and generate a score for the
user) you can use the millis() function.
-The joystick has a hard time pushing the button if it is moved to the
extremes in either the x or y direction, restrict the x target to a range where
it does not appear at the extremes.
-use the Arduino "tone" command to generate sound. Use a short for loop to
create a changing sound, such as a siren.
-compare the x and y coordinates of the x and the 0 to determine a hit when
the button is pressed
Hit the Objective: To create a video game using a

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!