Skip to content

Snake game running any low cost microprocessor (STM32, ESP, arduino, etc..), displayed with u8g2 driver for many cheap displays (like SSD1306, etc...). Very good portability.

License

Notifications You must be signed in to change notification settings

norbertg1/Snake-game

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Snake Game

Snake game running various microprocessor, displayed with u8g2 driver on any small display, developed in C++.

This repository is forked from arduino-snake-game. For more info check it.
Main modifications were porting to STM32 microcontroller, simpler files structure and much better portability for any low cost microprocessor system.

Input pins can be changed in the main sketch file. It should be easily portable to other displays, just change the renderer.cpp and if needed adjust board size in snake.h too.

Portability

As it is, its runnable on STM32F3 microprocessor family you only need to provide some startup code and settings for desired microprocessor (with CubeMX, stm32ide, etc.).

With main macro switch in snake_start.h file you can switch between Arduino and microprocessors.

For other microprocessors you must provide own codes for:

  • writing on display with u8g2 (see the examples section)
  • buttons handling
  • miliseconds delay
  • get elapsed microseconds
  • random number generator

Launching the game is initiated with calling snake_start(void* u8g2) function.

About

Snake game running any low cost microprocessor (STM32, ESP, arduino, etc..), displayed with u8g2 driver for many cheap displays (like SSD1306, etc...). Very good portability.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 85.2%
  • C 14.8%