COMP9032 Project

Description:
COMP9032 Project
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.)
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 Result Indicator
Push Button

浙大学霸代写 加微信 cstutorcs
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.
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).
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.
Result Indicator
程序代写 CS代考 加微信: cstutorcs
Result Indicator
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.
[1] https://www.megafungames.com/games/cup_game/

Code Help
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.
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
 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