Sale!

COMP9032 Project solution

$30.00 $25.50

Category:

Description

5/5 - (3 votes)

Description:
Cup and Ball [1] is an online game where a ball is shuffled under three
cups and you guess the position of the ball. For each guess, you gain one point if
it is correct or lose one point if it is wrong. (Click the picture in Figure 1 for a fun
try on this game.)
LCD
LEDs Push Button
Keypad
Motor Figure 1
In this project, you will be working individually to develop a system, using the
AVR Lab board, to simulate the game (with some modifications).
In this system, the push button is used to start the game; Three LEDs are used to
represent the three cups, and these LEDs together with the motor are also used
to indicate the ball shuffling among the three cups; the key board (replacing the
mouse in the original game) is used for the player to make a guess; the player’s
score is displayed on LCD, as indicated in Figure 1.
For the LED bar on the lab board, two groups of LEDs are used, as shown in
Figure 2. Three LEDs, called cup LEDs, are associated with three cups (as
mentioned before) and the four LEDs of the other group work as a result indicator
for a guess. When a guess is correct, the indicator will flash.
1 2 3
LED Bar
Result Indicator Figure 2
Each operation of the system and the related inputs/outputs are described below.
1. After the simulation system is turned on (i.e. the lab board is powered on), the
system is initialized and the ball is with an arbitrarily cup. In this case,
a. “Ready…” is displayed on LCD;
b. The cup LED with the ball is on, as illustrated in Figure 3 (a), where the
ball is with Cup 3. Other LEDs are off.
1 2 3 Result Indicator
Figure 3 (a)
2. When the push button is pressed, the game starts and the ball is shuffled
under the three cups. In this case,
a. “Start …” is displayed on LCD;
b. Motor spins;
c. Three cup LEDs are all on, but in dimmed light; other LEDs remain
off, as shown in Figure (b).
1 2 3 Result Indicator
Figure 3 (b)
3. When the player wants to make a guess for the ball position by pressing the
push button again, the ball shuffle stops. In this case,
a. The motor stops;
b. The three cup LEDs remain dimmed, as shown in Figure (3)(b);
c. After the player keys in the ball position on the key pad, the cups are
removed, the ball position is uncovered and the score is determined. In
this case,
i. The cup LED with the ball is fully on, as illustrated in Figure 3
(c), where the ball is now with Cup 2;
ii. If the player’s guess is correct, the score on the LCD is
incremented by 1 and the indicator will flash a few times, as
illustrated in Figure 3 (c)(i); otherwise,
iii. If the guess is incorrect, as illustrated in Figure 3 (c)(ii), the
score on LCD is decremented.
1 2 3 ( i ) Result Indicator win
1 2 3 ( ii )
Result Indicator Figure 3 (c)
4. When the player’s score becomes zero, the game will be reset to the initial
start status; otherwise, the game can be continued by pressing the button for
a new round of ball shuffle.
In your design, you need to decide how to shuffle the ball. You can add extra
functions to make your design better (which is optional) and you are also allowed
to make assumptions that you think are necessary but not given in this project
specification.
Reference
[1] https://www.megafungames.com/games/cup_game/
Submission Information:
The following items should be submitted:
1. Source code. Your program should be well commented.
2. User manual (up to 3 pages). The user manual describes how to use your
simulation system, including how to wire up the AVR lab board.
3. Design manual (up to 5 pages). The design manual describes how you
design the simulation system.
Both manuals should be written well. A person with knowledge about the course
and the lab board should understand how your system is designed and how to
use your system after reading the given manuals.
Grading
The project is worth 15% of your course result and will be marked under the
following criteria:
 Implementation to be demonstrated in lab (75%):
o Adherence to specification
o Implementation of all specified functions and the related inputs and
outputs.
 Code Style (5%):
o Easy to read
o Well documented
 User Manual (5%)
o Clear description
o Clear user instruction
 Design Manual (15%)
o Adherence to specification
o Readability and completeness
Demonstration: your lab class in Week 13.
Hard copy submission: the two manuals, your lab class in Week 13.
Electronic submission: the source code, Friday Week 13