Skip to content

A handheld block breaker game based on NUCLEO-F401RE (STM32F401RE), using joystick input and 7x11 LED matrix

License

Notifications You must be signed in to change notification settings

YuxuanHan0326/stm32-block-breaker-game

Repository files navigation

STM32 Based Handheld Brick Breaker Game

Note: This is an university coursework. Permission had been obtained from the module lead to upload the project files to GitHub.

Introduction

This is a simple brick breaker game, made up of:

The project is created using STM32CubeIDE

Overview: plot

Gameplay

plot

Game Fail:
plot

Score and Other Info:
Via UART2 (STLink USB) at baud rate 115200, 8 bits data, no parity, 1 stop bit
plot
Clock speed of the game main can be viewed via the flashing frequency of the on board LED (LD2, Green)

Basic Controls

Function Control
Pause / Continue Game Short CLICK Pushbutton
Left Shift Paddle Joystick LEFT
Right Shift Paddle Joystick RIGHT
Increase Game Clock Speed (Bonus ++) Joystick UP
Decrease Game Clock Speed (Bonus --) Joystick DOWN
Engage (Disengage) Autoplay Long PRESS Pushbutton

Game Rules

Initial Bonus = 1

WIN -> All blocks cleared.

  • Score = Score + Bonus
  • Game main clock speed automatically increases once, reset bonus: Bonus = 1

LOSE -> Ball fall off from the bottom line

  • You lose all the scores

Difficulty Adjustment -> Joystick UP / DOWN

  • Increase clock speed: Bonus ++
  • Decrease clock speed: Bonus --

Pin Configuations

plot

Pin State Connect To
PB6 I2C1_SCL LED Matrix SCL
PB7 I2C1_SDA LED Matrix SDA
PA12 GPIO_Input (Pull Up) Joystick Pushbutton
PA6 ADC1_IN6 Joystick VRX
PA7 ADC1_IN7 Joystick VRY
PB0 ADC1_IN8 Leave Floating (to generate random numbers)
PA5 GPIO_Output LD2

Important: All Vcc of the peripherals should be connected to 3.3V

About

A handheld block breaker game based on NUCLEO-F401RE (STM32F401RE), using joystick input and 7x11 LED matrix

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published