Skip to content

Using STM32 to create the game of snake and display it on screen through VGA.

Notifications You must be signed in to change notification settings

yuukidach/STM32-VGA-snake

Repository files navigation

STM32 VGA Snake Game

Video

Bilibili
Youtube

Descriptions

Creating a snake game with STM32, and showing it on the screen through VGA. It's quite a simple project that we can finish it in no time. It's also easy to test. All we need are just a screen, some DuPont lines and focus.

VGA settings: 800 x 600 @ 56Hz
(Real pixel value: 400 x 200)

Material

STM32F103C8
VGA line
Potentiometer
PS2 controller

Pin Connections

Pin Function
PA1 Vsync
PA7 Green
PA8 Hsync
PB4 DATA
PB5 CMD
PB6 CS
PB7 CLK

Part of The Code Explaintion

The part of VGA is copied from here. You can click the link and see more details.

snake.c is the main part of the project. It contains the game's core code. Since it is easy to understand and write, I did not add to much notations in it. The body of the snake is stored by a list. By the way, the snake's head and tail are opposite to the head and tail of the list. Try not to be confused.

adcrand.c uses adc to generate random number. It's more stochastic than using timer.

About

Using STM32 to create the game of snake and display it on screen through VGA.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published