Skip to content

Commit 3fc6b5c

Browse files
authored
Final documentation (#1433)
1 parent e5a24eb commit 3fc6b5c

3 files changed

Lines changed: 119 additions & 46 deletions

File tree

website/versioned_docs/version-fils_en/project/2026/delia.vasile1402/architecture.svg

Lines changed: 102 additions & 39 deletions
Loading
40.9 KB
Loading

website/versioned_docs/version-fils_en/project/2026/delia.vasile1402/index.md

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ A virtual pet that lives, grows, and misses you when you're away
1010

1111
## Description
1212

13-
A Tamagotchi (digital pet) built on the STM32 NUCLEO-U545RE-Q microcontroller, programmed entirely in Rust. The system uses a finite state machine with concurrent async tasks. It provides visual feedback via an OLED screen, audio feedback via a PWM-driven passive buzzer, and accepts input via three physical buttons (Feed, Play, Sleep). The pet's state (hunger, happiness, fatigue) degrades over time using the microcontroller's internal RTC, so the pet continues to age even when the device is idle.
13+
A Tamagotchi (digital pet) built on the STM32 NUCLEO-U545RE-Q microcontroller, programmed entirely in Rust. The system uses a finite state machine with 11 distinct pet states and 5 concurrent async tasks running on the Embassy framework. It provides visual feedback via an SH1106 OLED screen with custom pixel-art animations, audio feedback via a PWM-driven passive buzzer with unique melodies per state, and accepts input via three physical buttons (Feed, Play, Sleep). The pet's stats (hunger, happiness, fatigue) decay over time, driving state transitions and triggering warning sounds.
1414

1515
## Motivation
1616

@@ -22,7 +22,7 @@ I chose this project because it combines several embedded systems concepts (asyn
2222

2323
The main components of the system are:
2424
- **STM32 NUCLEO-U545RE-Q** — main microcontroller with internal RTC running Embassy/Rust
25-
- **SSD1306 OLED screen** — displays the pet's current state via I2C
25+
- **SH1106 OLED screen** — displays the pet's current state via I2C
2626
- **3 push buttons** — user input (Feed, Play, Sleep) via EXTI interrupts
2727
- **Passive buzzer + transistor** — audio feedback via hardware PWM
2828

@@ -40,12 +40,19 @@ Set up the development environment and started experimenting with Embassy on the
4040
### Week 10 - 11
4141
Developed the KiCad schematic and assembled the prototype for the project.
4242

43+
### Week 12
44+
Implemented the pet FSM, display rendering, button input, and PWM audio.
45+
46+
### Week 13
47+
Debugged async task interactions. Tuned gameplay parameters and finalized the hardware assembly.
48+
4349
## Hardware
4450

45-
The project uses the STM32 NUCLEO-U545RE-Q as the main microcontroller. An SSD1306 OLED screen is connected via I2C. Three push buttons handle user input and a passive buzzer driven by a transistor provides audio feedback. Time tracking is handled by the microcontroller's built-in RTC.
51+
The project uses the STM32 NUCLEO-U545RE-Q as the main microcontroller. An SH1106 OLED screen is connected via I2C. Three push buttons handle user input and a passive buzzer driven by a transistor provides audio feedback.
4652

4753
![Hardware photo](hardware.webp)
4854

55+
![Final project photo](finalproject.webp)
4956
## Schematics
5057

5158
![KiCad Schematic](schematic.webp)
@@ -55,7 +62,7 @@ The project uses the STM32 NUCLEO-U545RE-Q as the main microcontroller. An SSD13
5562
| Device | Usage | Price |
5663
|--------|-------|-------|
5764
| STM32 NUCLEO-U545RE-Q | Main microcontroller ||
58-
| SSD1306 OLED screen | Graphical interface | 20 RON |
65+
| SH1106 OLED screen | Graphical interface | 20 RON |
5966
| 3x Push buttons | User input (Feed/Play/Sleep) | 5 RON |
6067
| Passive buzzer + transistor | Audio feedback | 6 RON |
6168
| Jumper wires + breadboard | Assembly | 15 RON |
@@ -64,10 +71,13 @@ The project uses the STM32 NUCLEO-U545RE-Q as the main microcontroller. An SSD13
6471

6572
| Library | Description | Usage |
6673
|---------|-------------|-------|
67-
| `embassy-stm32` | Async HAL for STM32 | I2C, EXTI, Timers, RTC |
68-
| `embassy-time` | Async time management | Managing concurrent tasks |
74+
| `embassy-stm32` | Async HAL for STM32 | I2C, EXTI, TIM3 PWM, RCC |
75+
| `embassy-executor` | Async task executor | 5 concurrent tasks, cooperative scheduling |
76+
| `embassy-time` | Async time management | Timers, tick scheduling, debounce |
77+
| `embassy-sync` | Sync primitives | Mutex, Channel for shared state |
6978
| `embedded-graphics` | 2D graphics library | Drawing to the OLED display |
70-
| `ssd1306` | Display driver for SSD1306 | Used for the OLED screen |
79+
| `sh1106` | Display driver for SH1106 | Used for the OLED screen |
80+
| `embedded-hal 0.2` | Hardware | PWM trait for buzzer control |
7181
| `defmt` | Logging framework | Debugging |
7282

7383
## Links

0 commit comments

Comments
 (0)