You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website/versioned_docs/version-acs_cc/project/2026/cristina.ion0109/index.md
+44-13Lines changed: 44 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,9 +42,16 @@ I connected all hardware components. I verified all electrical connections.
42
42
43
43
I tested every module individually. I configured the Rust development environment and I started writing the initial firmware.
44
44
45
-
### Week 5 - 11 May
46
-
47
45
### Week 12 - 18 May
46
+
I implemented the core game firmware using the Rust Embassy async framework.
47
+
48
+
I integrated all hardware components into asynchronous tasks. This includes LEDs, buttons, photoresistors, the potentiometer, the servo, and the buzzer.
49
+
50
+
I added the scoring logic and life tracking system. I implemented precise reaction time measurement for each round. I also configured the display to show real-time stats, rounds and game-over screens.
51
+
52
+
I implemented a comprehensive False Start detection system. It monitors all inputs simultaneously during the random waiting phase.
53
+
54
+
I have integrated audio feedback using the buzzer. The system now plays distinct sounds for correct and incorrect actions.
48
55
49
56
### Week 19 - 25 May
50
57
@@ -56,13 +63,15 @@ Main parts:
56
63
- STM32 Nucleo Board - This is the main controller of the device. It generates stimuli, reads inputs from buttons and sensors, measures reaction time, and manages the game logic, including scoring, error detection and game mode selection
57
64
- LEDs - These are used as visual stimuli. When a specific LED lights up, the user must press the corresponding button as quickly as possible. They provide a simple and fast way to test reaction to visual signals
58
65
- Buttons - These are the main input devices for the user. Each button corresponds to a specific action or stimulus. The system detects button presses and checks whether the response is correct and within the allowed time
59
-
- Buzzer - This component generates audio stimuli. When a sound is played, the user must respond by rotating the potentiometer
66
+
- Active Buzzer - This component generates audio stimuli. When a sound is played, the user must respond by rotating the potentiometer
67
+
- Passive Buzzer - This component generates audio feedback based on game outcomes
60
68
- Potentiometer - This component is used to detect user input. In response to certain stimuli (sound), the user must rotate the potentiometer. The STM32 reads its value and determines whether the action was performed correctly
61
69
- Photoresistors - These sensors detect changes in light intensity. The system can display instructions such as covering a specific sensor, and the user must react
62
70
- Servo Motor: The servo is used to create a mechanical stimulus by raising a small flag. When the flag is lifted, the user must press a specific button
63
71
- Display (LCD): The display is used to show instructions, reaction times and game statistics. It also provides a menu for selecting the game mode and guides the user throughout the session
64
72
65
73
74
+
66
75
### Schematics
67
76
68
77

@@ -87,35 +96,57 @@ The format is
87
96
|[LED](https://www.drot.ro/platforma-arduino/1035-led-dioda-albastra-5-mm.html)| Stimulus | 0,44 RON |
88
97
|[Potentiometer](https://www.drot.ro/platforma-arduino/7597-potentiometru-liniar-10k-ohm.html)| Analog input | 3,92 RON |
89
98
|[Servomotor sg90](https://www.bitmi.ro/electronica/servomotor-sg90-180-grade-9g-10496.html#resp-tab2)| Stimulus | 9,99 RON |
90
-
|[3 x Photoresistor](https://www.bitmi.ro/electronica/modul-senzor-cu-fotorezistor-ldr-compatibil-arduino-10394.html)| Light-dependent input | 2,43 RON |
99
+
|[3 x Photoresistor](https://www.bitmi.ro/electronica/modul-senzor-cu-fotorezistor-ldr-compatibil-arduino-10394.html)| Light-dependent input | 3 x 2,43 RON |
100
+
|[Passive buzzer](https://www.bitmi.ro/electronica/modul-buzzer-pasiv-ky-006-10678.html#resp-tab2)| Audio feedback | 2,99 RON |
91
101
|[Active buzzer](https://www.bitmi.ro/electronica/modul-buzzer-activ-compatibil-arduino-10397.html)| Stimulus | 3,24 RON |
92
-
|[Breadboard](https://www.bitmi.ro/electronica/breadboard-830-puncte-mb-102-10500.html)| - | 13,99 RON |
102
+
|[Breadboard](https://www.bitmi.ro/electronica/breadboard-830-puncte-mb-102-10500.html)| For prototyping and power distribution | 13,99 RON |
103
+
|[Breadboard](https://www.bitmi.ro/electronica/breadboard-400-puncte-pentru-montaje-electronice-rapide-10633.html)| For prototyping and power distribution | 6,99 RON |
93
104
|[LCD Display](https://www.bitmi.ro/electronica/display-lcd1602-hd44780-albastru-iluminat-10486.html)| Human-Machine Interface | 13,99 RON |
94
105
|[I2C LCD Interface Module](https://www.bitmi.ro/electronica/modul-interfata-i2c-pentru-lcd1602-10456.html)| I2C converter | 9,99 RON |
|[Buttons](https://www.drot.ro/platforma-arduino/1253-microswitch-buton-6-x-6-x-6-mm.html)| Digital inputs | 0,44 RON |
97
-
|[Buttons](https://www.drot.ro/platforma-arduino/1180-mikroswitch-tc-1212t-12-x-12-x-7-3-mm-smd-pcb.html)| Digital inputs | 0,87 RON |
107
+
|[Buttons](https://www.drot.ro/platforma-arduino/1180-mikroswitch-tc-1212t-12-x-12-x-7-3-mm-smd-pcb.html)| Digital inputs | 6 x 0,87 RON |
108
+
|[Male-to-Male jumper wires](https://www.bitmi.ro/electronica/40-x-fire-dupont-tata-tata-20cm-10511.html)| For breadboard and peripheral connections | 8,99 RON |
109
+
|[Male-to-Female jumper wires](https://www.bitmi.ro/electronica/40-x-fire-dupont-tata-mama-20cm-10512.html)| For breadboard and peripheral connections | 6,99 RON |
98
110
99
111
100
112
113
+
## Software
101
114
115
+
The firmware is built using Rust and the Embassy async framework, allowing efficient, non-blocking execution of multiple game elements simultaneously.
102
116
117
+
1. Centralized Game Management:
103
118
119
+
The core game loop operates as a finite state machine that coordinates the entire gameplay experience:
104
120
121
+
- It supports two distinct game modes: Normal Mode (a balanced gameplay experience with fixed, comfortable timeout windows for each round, allowing the player to focus on accuracy), Speed Mode (An intense mode where the system automatically reduces the timeout window as the player advances through rounds, demanding faster reaction times)
122
+
- Random Round Selection: Dynamically switches between 4 distinct round types (LED, Potentiometer, Photoresistor, or Servo)
123
+
- State & Life Tracking: Manages the player's lives, increments scores, and triggers the appropriate game-over or victory transitions
105
124
125
+
2. Multi-Peripheral Asynchronous Integration
106
126
127
+
- Inputs (Buttons & Servo Trigger): Managed through hardware interrupts (EXTI) and thread-safe signals (Signal) to capture user actions instantly
128
+
- Outputs (Display & Buzzer Tasks): Run as independent background tasks that wait for instructions through Channel queues. This prevents screen updates and audio generation from freezing or lagging the main game logic
129
+
- Analog Sensors (Potentiometer & Photoresistors): Sampled smoothly via the ADC during specific gameplay windows to accurately read light levels and potentiometer positions
130
+
131
+
3. Anti-Cheating - detect false start
132
+
133
+
An active monitoring system runs during the random waiting phase ("Get ready..."). It polls all hardware entry points simultaneously (buttons, potentiometer, and all 3 light sensors). By calculating the change of the analog inputs, it securely catches any premature movement or light alterations regardless of environmental conditions, instantly penalizing the player
107
134
108
-
## Software
109
135
110
136
| Library | Description | Usage |
111
137
|---------|-------------|-------|
112
-
|[st7789](https://github.com/almindor/st7789)| Display driver for ST7789 | Used for the display for the Pico Explorer Base |
113
-
|[embedded-graphics](https://github.com/embedded-graphics/embedded-graphics)| 2D graphics library | Used for drawing to the display |
138
+
|[embassy-stm32]| The main library that connects the Rust code to the STM32 hardware | Used to initialize and configure all physical pins and peripherals: ADC (sensors), PWM (servo/buzzer), I2C (display communication), and EXTI (interrupt-based buttons). |
139
+
|[embassy-time]| Time management utilities for delays, timestamps, and intervals | Used for the sensor polling loops to catch cheating, enforcing maximum response deadlines (timeouts) for each round, and measuring the player's exact reaction time |
140
+
|[embassy-executor]| The runtime task manager for asynchronous execution | Used to launch and run multiple separate tasks (like the game manager, display updates, and buzzer sounds) concurrently |
141
+
|[embassy-futures]| Async flow control and concurrency utilities | Uses select and select3 to monitor multiple events at the same time |
142
+
|[embassy-sync]| Thread-safe synchronization primitives for communication | Uses Channel and Signal to safely pass data (like button events or display commands) between different running tasks |
143
+
|[hd44780_driver]| Hardware driver for the HD44780-compliant character LCD display | Used to initialize the screen mode, control the cursor, and print real-time game text (scores, lives, and states) via the I2C bus |
144
+
114
145
115
146
## Links
116
147
117
148
<!-- Add a few links that inspired you and that you think you will use for your project -->
0 commit comments