Skip to content

Commit ffd89c5

Browse files
Documentation - Rhythm Game (#1065)
* Initial documentation * Added Bill of Materials, Initial Software & Hardware. Updated Log * Added KiCAD schematics * Fix merge conflicts in documentation * Update * Added software details & diagram * Solved photo issue * Solved photo issue --------- Co-authored-by: az3xxx <alexiaelenam@gmail.com>
1 parent 8c4b4ff commit ffd89c5

6 files changed

Lines changed: 76 additions & 6 deletions

File tree

Binary file not shown.
13.4 KB
Loading

website/versioned_docs/version-acs_cc/project/2026/elena_alexia.mocanu/index.md

Lines changed: 76 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ Hardware Rhythm Game
1010

1111
## Description
1212

13-
Rhythm game follows the standard mechanics of this genre: the player needs to hit the notes at the right time using the buttons on the breadboard. There are multiple types of notes: tap notes, hold notes, and motion notes triggered by moving the breadboard up/down on the table. Visual feedback is provided using LEDs, where the color represents the accuracy. \
14-
Every hit note fills up the color match progress bar. Once the bar is full, the game enters a special mode called "Color Match". In this mode, the player needs to match the color of the LEDs with those shown on the screen using RGB channels. Failing to finish the game mode successfully will make the player lose one life. The player starts with three lives and can replenish one after completing a song. \
13+
Rhythm game follows the standard mechanics of this genre: the player needs to hit the notes at the right time using the buttons on the breadboard. There are multiple types of notes: tap notes, hold notes, and motion notes triggered by moving the breadboard up/down on the table. Visual feedback is provided using RGB LEDs, where the color represents the accuracy. \
14+
The player needs to accumulate a certain number of hit notes within the time limit to trigger the special game mode called "Color Match". Failing to trigger this game mode will make the player lose one life. In this mode, the user needs to match the color of the RGB LEDs with those shown on the screen using RGB channels. Failing to finish the game mode successfully will deduct one life. The player starts with three lives and can replenish one after completing a song. The player wins when all songs in the current playlist are completed successfully. \
1515
The game is accompanied by music, and players can customize which set tracks are playing and in what order.
1616

1717
## Motivation
@@ -20,7 +20,7 @@ I chose this project because I like rhythm games. Combining them with hardware w
2020

2121
## Architecture
2222

23-
![](./arhitectura_diagrama.webp)
23+
![](./arhitecture_diagram.webp)
2424

2525
Main components:
2626

@@ -42,12 +42,12 @@ Main components:
4242
- communicates through I2C
4343

4444
*Feedback*:
45-
- **LEDs**
45+
- **RGB LEDs**
4646
- hit accuracy visual feedback
4747
- controlled via PWM pins
4848
- **Servomotor**
49-
- color match progress bar visual feedback
50-
- when it reaches 180° it means the bar is full
49+
- color match progress visual feedback
50+
- when it reaches 180° it means the color match progress is 100%
5151
- controlled via PWM pins
5252

5353
*Music*:
@@ -66,7 +66,77 @@ Main components:
6666

6767
I wrote the initial documentation.
6868

69+
### Week 20 - 26 April
6970

71+
I tested the functionality of the components.
72+
73+
### Week 27 April - 3 May
74+
75+
I implemented the UI interface and the button logic.
76+
77+
### Week 4 - 10 May
78+
79+
I wrote the logic for the rhythm game and color match.
80+
81+
### Week 11 - 17 May
82+
83+
I integrated the music and sounds effects into the game and wrote the logic for the volume and playlist menu.
84+
85+
## Week 18 - 24 May
86+
87+
I made multiple tests to ensure the game is working properly and calibrated game parameters to ensure the gameplay experience is smooth.
88+
89+
## Hardware
90+
91+
The project uses the STM32 Nucleo Board as the main controller. An LCD Display is used for rendering the game graphics. User input is taken using push buttons. While in game, visual feedback is given using RGB LEDs for hit accuracy, and a servomotor for color match progress. The music is played using a DFPlayer Mini that has a microSD card and a speaker. A passive buzzer is used for sound effects. The motion notes are detected using a gyroscope.
92+
93+
![](./poza_cablaj.webp)
94+
95+
### Schematics
96+
![](./schematics.webp)
97+
98+
### Bill of Materials
99+
100+
| Device | Usage | Price |
101+
| ------------------------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
102+
| STM32 Nucleo-U545RE-Q | The microcontroller | [Provided by faculty](https://www.st.com/en/evaluation-tools/nucleo-u545re-q.html) |
103+
| TFT LCD Display | Displaying the game graphics | [21,60 RON](https://www.emag.ro/display-tactil-tft-lcd-240-x-320-px-cu-cititor-sd-spi-2-4-inch-gri-rosu-tft-24-ili9341-restouch-spi/pd/D49CJMYBM/) |
104+
| Buttons | User input | [1,5 RON X 7](https://www.emag.ro/set-25-butoane-tactile-chucai-12x12x7-3mm-multicolor-a-md390/pd/DRPKD83BM/) |
105+
| Gyroscope MPU 6050 GY-521 | Detecting the breadboard movement | [31,99 RON](https://www.emag.ro/modul-giroscop-mpu-6050-gy-521-accelerometru-arduino-3-axe-2-1-cm-x-1-1-cm-x-0-3-cm-albastru-c7/pd/DL3G1QYBM/) |
106+
| RGB LEDs | Visual feedback | [1,33 RON X 4](https://www.emag.ro/set-10-x-led-rgb-5-mm-se2301081533/pd/D8VDVRMBM/) |
107+
| Servomotor SG90 180° | Visual feedback | [26,14 RON](https://www.emag.ro/servomotor-genelec-sg90-0-180-grade-22x11-5x22-5mm-gd-0228/pd/DGMQ44YBM/) |
108+
| DFPlayer Mini TF-16P | Audio player for the music tracks | [18,03 RON](https://www.emag.ro/modul-tf-16p-dfplayer-mini-player-audio-24-biti-32-gb-negru-auriu-5904162801930/pd/D8B8KLMBM/) |
109+
| Speaker | Audio output for the music tracks | [< 19,68 RON](https://www.emag.ro/modul-inregistrare-redare-audio-isd1820-cu-difuzor-3-5v-3-b-044/pd/DLXDNLMBM/) |
110+
| MicroSD Card | Storing music files | [29,98 RON](https://www.emag.ro/card-de-memorie-microsd-premium-32-gb-hc-i-class-10-qeno-100mb-s-pentru-camera-auto-telefon-aparat-foto-hub-console-negru-card32gb/pd/DBTYN2YBM/) |
111+
| Pasive Buzzer | Sound effects | [12,48 RON](https://www.emag.ro/buzzer-pasiv-pe-pcb-elektroweb-fara-generator-convertor-5-v-3-d-012/pd/DSLMTMYBM/) |
112+
113+
114+
## Software
115+
116+
| Library | Description | Usage |
117+
| ------------------------------------------------------------------------------------ | ----------------------------------------------------------------- | ------------------------------------------------------------- |
118+
| [embassy-stm32](https://github.com/embassy-rs/embassy/tree/main/embassy-stm32) | Hardware Abstraction Layer for STM32 | Used for control of GPIO, SPI, I2C, UART, and PWM peripherals |
119+
| [embassy-executor](https://github.com/embassy-rs/embassy/tree/main/embassy-executor) | Async task executor | Used to manage concurrent tasks |
120+
| [embedded-hal](https://github.com/rust-embedded/embedded-hal) | Hardware abstraction traits | Used for interacting with peripherals |
121+
| [defmt](https://github.com/knurling-rs/defmt) | Logging framework | Used for debugging |
122+
| [panic-probe](https://github.com/knurling-rs/probe-run/tree/main) | Panic handler | Used for monitoring fatal code errors |
123+
| [embassy-time](https://github.com/embassy-rs/embassy/tree/main/embassy-time) | Timekeeping, delays and timeouts | Used for calculating game time |
124+
| [embassy-sync](https://github.com/embassy-rs/embassy/tree/main/embassy-sync) | Synchronization primitives and data structures with async support | Used for managing signals and channels |
125+
| [heapless](https://github.com/rust-embedded/heapless) | Data structures that don't require dynamic memory allocation | Used to store game data in vectors |
126+
| [core](https://github.com/rust-lang/rust/tree/main/library/core) | Rust standard library | Used for debug and write operations |
127+
| [mipidsi](https://github.com/almindor/mipidsi) | Display driver for ILI9341 | Used for connecting the screen via SPI |
128+
| [embedded-graphics](https://github.com/embedded-graphics/embedded-graphics) | 2D graphics library | Used for drawing the game graphics |
129+
130+
131+
![](./software_diagram.webp)
132+
133+
The game runs in a continuous loop where it checks the current game state:
134+
- *Start Menu*: the user chooses the next game state from the available options
135+
- *Volume Menu*: the user can adjust the volume level of the music and turn on/off the sound effects
136+
- *Playlist menu*: the user can edit the songs and their playback order during the game
137+
- *Rhythm game*: the user is in a game; the game state switches to color mode when the color mode progress reaches 100%, to start menu when a game is won/lost and again to rhythm game when a song, excepting the last one, is completed
138+
- *Color mode*: the user is in color mode; the game state switches to rhythm game after succesful completion or if the player is not out of lives after failing to complete the mode; if the player is out of lives, the game state switches to start menu
139+
- *Exit*: the program stops after the user chooses this option
70140

71141

72142

54.8 KB
Loading
42.5 KB
Loading
23.5 KB
Loading

0 commit comments

Comments
 (0)