Skip to content

zlociu/2019_LEDtetris

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 

Repository files navigation

2019_LEDtetris

Overview 👁️

Project of classic game "Tetris". The main screen is 16x8 LED matrix; sterring with analog buttons. Scoreboard is on four 7-segment displays. When game is on, is played song "Korobeiniki". Simple, but makes a lot of fun !

Description 📋

Software

There is only an application on STM32 (project compiled and run on STM32F407G). Computer is used only to compile and transfer program.

Hardware

  1. STM32F407G-DISC1 STMicroelectronics,
  2. 16x8 red LED Matrix Waveshare,
  3. Analog Test Board with Speaker Waveshare,
  4. 4x 8-segment module Botland,
  5. Analog 5-key Keyboard Keyes,
  6. AC adapter with miniUSB Type B. Recommended parameters: 5V, >=0.5A.

Tools 🛠️

Software

  1. STM32CubeMX v4.27.0
  2. System Workbench for STM32 (Neon.3 Release v4.6.3)
  3. STMStudio v3.6.0 (for debugging)
  4. ST-LinkUpgrade

❗ Getting most of this software require registration on producent sites.

How to run ⚙️

To transfer program to microcontroller needs miniUSB-B cable. To run everything, needs only AC adapter.
❗ It's important to upgrade ST-Link firmware on STM32, because after plugging AC adapter to microcontroller, ST-Link controller will reset system continuously, program will never run. Use ST-LinkUpgrade program to get the latest version of ST-Link firmware. Microcontroller and most of additional devices needs 5V. Only 7-segment display and buttons need 3,3V. When AC adapter is not available, it's possible to power up device from computer via USB cable, but it's not preffered. Other option is used powerbank (needs intensity at least 0.5A).

Connections to STM32F407G

LED MATRIX
  • PIN 5V
  • PIN PA5 (SCK)
  • PIN PA7 (MOSI)
  • PIN PC5 (CS)
  • PIN GND
8-SEGMENT DISPLAY
  • PIN 3.3V
  • PIN PE0, PE1, PE2, PE3, PE4, PE5, PE6 (GPIO_OUT)
  • PIN PB12, PB13, PB14, PB15 (GPIO_OUT)
BUTTONS
  • PIN 3.3V
  • PIN PA1 (ADC_IN)
  • PIN GND
SPEAKER
  • PIN 5V (to speaker)
  • PIN PA4 (DAC_OUT)
  • PIN GND

How to compile 💻

Import project to System Workbench and click on 'RUN' button. Everything should be upload to STM32. Microcontroller should be connected to the computer :).

Future improvements ✏️

Maybe second screen to display next shape. MAYBE !!

Addition 💡

The project was conducted during the Microprocessor Lab course held by the Institute of Control and Information Engineering, Poznan University of Technology. Supervisor: Tomasz Mańkowski.

About

Tetris game on STM32 microcontroller.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 99.3%
  • Other 0.7%