simulation system代写 Cup and Ball  is an online game where a ball is shuffled under three cups and you guess the position of the ball.
Cup and Ball  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.
Each operation of the system and the related inputs/outputs are described below.
- 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 thiscase,
- “Ready…” is displayed onLCD;
- 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.
Figure 3 (a) simulation system代写
- When the push button is pressed, the game starts and the ball is shuffled under the three cups. In this case,
- “Start …” is displayed onLCD;
- Motor spins;
- Three cup LEDs are all on, but in dimmed light; other LEDs remain off, as shown in Figure(b).
Figure 3 (b)
- When the player wants to make a guess for the ball position by pressing the push button again, the ball shuffle stops. In thiscase,
- The motorstops;
- The three cup LEDs remain dimmed, as shown in Figure(3)(b);
- 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 thiscase,
- The cup LED with the ball is fully on, as illustrated in Figure 3 (c), where the ball is now with Cup2;
- 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,
- If the guess is incorrect, as illustrated in Figure 3 (c)(ii), the score on LCD is
Figure 3 (c)
- 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.simulation system代写
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 simulation system代写
Submission Information:simulation system代写
The following items should be submitted:
- Source code. Your program should be well
- User manual (up to 3 pages). The user manual describes how to use your simulation system, including how to wire up the AVR lab
- Design manual (up to 5 pages). The design manual describes howyou design the simulation 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 simulation system代写
The project is worth 15% of your course result and will be marked under the following criteria:
- Implementation to be demonstrated in lab(75%):
- Adherence tospecification
- Implementation of all specified functions and the related inputs and outputs.
- Code Style(5%):
- Easy toread
- Welldocumented simulation system代写
- User Manual (5%)
- Clear userinstruction
- Design Manual (15%)
- Adherence tospecification
- Readability andcompleteness
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