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
The game 'Snake', displayed on an 8×8 LED Matrix module
2
+
# Date and thermometer clock
3
+
Display temperature, pressure, clock, and date on the LCD screen module.
4
4
5
5
:::info
6
6
@@ -11,70 +11,75 @@ The game 'Snake', displayed on an 8×8 LED Matrix module
11
11
12
12
## Description
13
13
14
-
My project is a recreation of the popular game 'Snake,' displayed on an 8×8 LED Matrix module using a Raspberry Pi.My aim is to create something that appears simple but holds many memories of my childhood and provides enjoyable entertainment.
14
+
This project showcases an advanced digital clock designed to do more than just tell time—it keeps you anchored in the present while helping you plan for the future. With its ability to display not only the current date and time but also real-time temperature and atmospheric pressure, this device serves as a daily companion that informs your decisions and enhances your awareness of the environment around you.
15
15
16
16
## Motivation
17
17
18
-
Creating a Snake game with Rust on a Raspberry Pi and LED matrix blends nostalgia with technical challenge, fostering both creativity and learning.
18
+
Time is the most precious resource we have; it’s the framework within which we set our goals and pursue our dreams. Every passing second grows into a minute, every minute into an hour, and so on—reminding us that life moves forward, whether we’re ready or not. In a world where deadlines define our progress and achievements, it’s easy to lose track of the days as they slip by. This digital clock was created to serve as an essential tool for staying grounded in time, helping manage not just the simplest but also the most complex actions in our lives. Along with keeping track of time, it also monitors temperature and atmospheric pressure, providing real-time environmental data that aids in daily decision-making.
19
19
20
20
## Architecture
21
+
Here is a clear architecture image:
22
+
23
+

24
+
25
+
According to the image here is an explanation about what each component does:
26
+
27
+
| The component | What is it | Why do we need it |
28
+
| --- | --- | --- |
29
+
|`Raspberry Pi Pico W`| A microcontroller board with built-in Wi-Fi. | The Pico W is the brain of your project. It controls all the other components and handles communication with the internet to get the current date and time.|
30
+
|`BMP280`| A device that measures the temperature and atmospheric pressure of its environment. |To monitor and display the temperature and pressure as part of your project. |
31
+
|`LCD screen`| A screen that shows information in a readable format. | To present the temperature, pressure, date, and time in a way that you can easily see and understand. It acts as the output interface of your project.|
32
+
|`Buzzer`| A small device that makes noise. |To provide audio feedback or alerts. For example, it could beep when the temperature or pressure reaches a certain threshold, or simply to signal that the system is active.|
33
+
|[`API Through Wifi`](http://worldtimeapi.org/api/timezone/Europe/Bucharest)|A web service that provides date and time information. |To get the current time and date from the internet.This way your project has accurate and up-to-date time information without needing a separate real-time clock module and can ensure your time information is always accurate.|
21
34
22
-

23
-
24
-
25
-
Game Engine:
26
-
Manages game state and logic.
27
-
Controls snake movement, food generation, and scoring.
28
-
Input Handling:
29
-
Interprets joystick input for controlling the snake.
30
-
Ensures responsive and accurate gameplay.
31
-
Display Management:
32
-
Controls LED matrix to represent the game grid.
33
-
Updates display in real-time based on game state.
34
-
Audio Feedback:
35
-
Uses buzzers to provide sound effects for game events.
36
-
Enhances player experience with auditory cues.
37
-
Game State Management:
38
-
Maintains current game state and information.
39
-
Facilitates communication between components.
40
-
User Interface (UI):
41
-
Provides visual indicators and feedback.
42
-
Enhances player engagement and experience.
43
-
44
-
- how they connect with each other
45
-
46
-
The Raspberry Pi is positioned at the center, serving as the main controller.
47
-
Components are arranged in a clear and organized manner around the Raspberry Pi.
48
-
Arrows indicate the direction of data flow or connection from the components to the Raspberry Pi.
49
-
Each component is labeled for clarity.
50
35
51
36
## Log
52
37
53
38
<!-- write every week your progress here -->
54
39
55
40
### Week 6 - 12 May
56
-
I tested the code for each component.
41
+
I bought the components .
57
42
58
43
### Week 7 - 19 May
59
-
Assembled the components on the breadboard. \
60
-
Making the schematic.
44
+
Tested codes for my project.
61
45
62
46
### Week 20 - 26 May
47
+
Worked on the documentation and posted my project.
63
48
64
49
## Hardware
65
-

50
+
| When connected | A closer look to the connection: |
About those two circles… I hope you didn’t notice them. But if you did, just keep going—they were supposed to be a heart, but let’s just say they’re cherry emojis 🍒. Or maybe a broken heart 💔, because let’s face it, time can be a bit of a heartbreaker.
66
56
67
-
My hardware setup comprises a Raspberry Pi Pico microcontroller, a breadboard serving as the main board, an 8×8 LED matrix module, a passive buzzer, a joystick module, and various wires for connection, a LED , a resistor.
57
+
I tried to make a 3D model here :) :
58
+
.
68
59
69
-
### Schematics
60
+
### Schematics:
70
61
71
-

62
+

72
63
73
-
The Raspberry Pi is positioned at the center, serving as the main controller.
74
-
Components are arranged in a clear and organized manner around the Raspberry Pi.
75
-
Arrows indicate the direction of data flow or connection from the components to the Raspberry Pi.
76
-
Each component is labeled for clarity.
64
+
The schematic image shows a clearer connection for the components , using the online simulator [*Wokwie*](https://wokwi.com/).
77
65
66
+
> [!NOTE]
67
+
> the lcd screen is connected by default to the pico explorer base .
68
+
69
+
the buzzer is connected (with a resistance) to GPIO 1.\
70
+
here is the BMP280 connection table
71
+
| PIN | connection with pico explorer ~ pico PIN|
72
+
| --- | --- |
73
+
|`VCC`| power source (3V3)|
74
+
|`GND`| ground |
75
+
|`SCL`|`12SCL` line ~ GP21 |
76
+
|`SDA`|`12SDA` line ~ GP20 |
77
+
|`CSB`| not used |
78
+
|`SDO`| not used |
79
+
80
+
81
+
> [!TIP]
82
+
> On the Pico Explorer base, the I2C pins are marked for simple use. You can check the back of the base to see which pins of the Raspberry Pi Pico they are tied to.
78
83
79
84
80
85
### Bill of Materials
@@ -85,28 +90,30 @@ The format is
85
90
-->
86
91
87
92
| Device | Usage | Price |
88
-
|-|-|-|
89
-
|[Raspberry Pi Pico WH, Wireless+Headers](https://www.raspberrypi.com/documentation/microcontrollers/raspberry-pi-pico.html)| The microcontroller | 56,23 RON |
90
-
| [Breadboard](https://ardushop.ro/ro/electronica/33-breadboard-830.html?search_query=breadboard&results=31) | Main board | 10,15 RON
91
-
|[L8x8 LED matrix + control circuit](https://ardushop.ro/ro/home/95-matrice-led-uri-8x8-circuit-de-control.html?search_query=matrix&results=8)| a screen to Display | 14,87 RON |
92
-
|[Passive Buzzer](https://ardushop.ro/ro/electronica/194-buzzer.html?search_query=buzzer&results=16)| Buzzer | 3,97 RON |
93
-
|[Joystick mode](https://ardushop.ro/ro/electronica/127-modul-joystick.html?search_query=joystick&results=4)| control the game | 3,60 RON |
94
-
| A LED | turns on when starting | 0 RON-I borrowed it |
95
-
| A resistor | current-limiting resistor| 0 RON-I borrowed it |
96
-
|[65 x Fire Jumper](https://ardushop.ro/ro/electronica/28-65-x-jumper-wires.html?search_query=fir&results=286)| connection | 11,86 RON |
97
-
|[40 x Dupont Yarn Mother-Father 10cm](https://ardushop.ro/ro/electronica/23-40-x-dupont-cables-female-male-10cm.html?search_query=fir&results=286)| connection | 5,18 RON|
|[Raspberry Pi Pico WH, Wireless+Headers](https://www.raspberrypi.com/documentation/microcontrollers/raspberry-pi-pico.html)| The microcontroller |[56 RON](https://ardushop.ro/ro/home/2819-raspberry-pi-pico-wh.html?search_query=pico&results=14)|
95
+
|[Pico Explorer Base](https://shop.pimoroni.com/products/pico-explorer-base?variant=32369514315859)|functional Base for components |[160 RON](https://www.optimusdigital.ro/en/others/12148-pico-explorer-base.html)|
96
+
|[Passive Buzzer](https://projects.raspberrypi.org/en/projects/introduction-to-the-pico/9)| Buzzer |[4 RON ](https://ardushop.ro/ro/electronica/194-buzzer.html?search_query=buzzer&results=16)|
97
+
|[BMP280](https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bmp280-ds001.pdf)| Digital pressure and temperature sensor |[17 RON ](https://www.emag.ro/modul-senzor-de-presiune-atmosferica-bmp280-cl214/pd/DGKX6JBBM/)|
98
+
|[65 x Fire Jumper](https://www.digikey.com/en/htmldatasheets/production/5367683/0/0/1/20ul1015strbla250)| connection |[12 RON](https://ardushop.ro/ro/electronica/28-65-x-jumper-wires.html?search_query=fir&results=286)|
99
+
|[40 x Dupont Yarn Mother-Father 10cm](https://www.digikey.com/en/htmldatasheets/production/5367683/0/0/1/20ul1015strbla250)| connection |[5 RON](https://ardushop.ro/ro/electronica/23-40-x-dupont-cables-female-male-10cm.html?search_query=fir&results=286)|
|[Embedded-graphics](https://github.com/embedded-graphics/embedded-graphics)| for drawing 2D graphics | for rendering graphics on displays |
108
+
|[embassy-rp](https://github.com/embassy-rs/embassy/tree/main/embassy-rp)| HAL for Raspberry Pi RP2040, supporting both blocking and async APIs for various peripherals. | Simplifies peripheral control on RP2040 with async support. |
109
+
|[embassy-executor](https://github.com/embassy-rs/embassy/tree/main/embassy-executor)| An async executor for embedded systems, part of the Embassy ecosystem. | Manages asynchronous tasks in embedded applications. |
110
+
|[embedded-hal](https://github.com/rust-embedded/embedded-hal)| Programming Language | Programming Language |
111
+
|[cyw43_pio](https://github.com/rp-rs/rp-hal/tree/main/boards/pico/cyw43_pio)|A library to control the Cypress CYW43 Wi-Fi chip using the Raspberry Pi Pico PIO. | Manages Wi-Fi connectivity for Raspberry Pi Pico. |
112
+
|[embassy-sync](https://github.com/embassy-rs/embassy/tree/main/embassy-sync)|Provides synchronization primitives like mutexes and channels for async code in embedded environments. |Enables safe concurrency in embedded applications. |
113
+
|[st7789](https://github.com/almindor/st7789)|A Rust driver for controlling ST7789 displays, compatible with embedded-hal. | Enables control and rendering on ST7789-based displays. |
108
114
## Links
109
115
110
116
<!-- Add a few links that inspired you and that you think you will use for your project -->
111
117
112
-
1. From last year projects: [project](https://ocw.cs.pub.ro/courses/pm/prj2023/apredescu/gameofsnake)
0 commit comments