Coder Social home page Coder Social logo

esp32-neopixel-tetris's Introduction

ESP32 Neopixel Tetris

Tetris playable on a WS2812B LED matrices via an ESP-Now remote.

Tetris Game

The Tetris game code became involved enough that I moved it to its own repository at 0xjmux/tetris. Since I designed it as a single-header library, this project only needs to import tetris.h/tetris.c, but I wanted to minimize the presence of all the other code for the x86 Linux driver, Unit tests, helpers, and CI in this repo.

Remote

I decided to use the Wizmote as a game controller because of its low cost and use of Espressif's ESP-NOW protocol, which I thought would be easy to receive via the ESP32's builtin antenna. This ended up being more difficult than anticipated, but does work relatively well - especially considering that I'm using a glorified lightswitch as my game controller.

Hardware

One of my personal goals was to complete a project of moderate complexity in which I designed the entire stack myself - Mechanical, Hardware, and Software.

As such, this project runs on my iot_leddriver PCB, and the final version will incorporate v3 of that board with a custom 3D printed enclosure for the 8x32 LED Matrix.

Project Goals

I designed this project to target areas of my skillset which I felt could use additional development. I wanted a better understanding of the entire embedded development toolchain and process, and needed a way to fill in the gaps between what school teaches and the skills that are required to be a competent embedded software engineer.

These goals included:

  • Write Tetris game code from scratch with minimal dependencies for embedded platforms using cross-platform development techniques. Code must be testable without hardware to expedite iteration and testing.
    • Set up CI from scratch for an embedded project using SIL techniques (tetris repo CI)
    • Learn CMake and set up the build system from scratch
    • Game needs to be runnable on low-powered devices using interrupts. Memory and compute requirements should be as minimal as possible.
    • Driver code needed to make a given display or controller work should be kept as minimal as possible, and supporting new hardware should be as easy as possible.
  • Teach myself embedded test-driven development and embedded unit testing using techniques from James Greening's "Test-Driven Development for Embedded C" (link)
  • Make extensive use of an RTOS and interrupts to make program more performant. Improve my skills using JTAG and OpenOCD/GDB to debug RTOS task-based programs.

Controls

Wizmote Button Action
ON None
OFF Quit Game
NIGHT Pause/Unpause
1 Left
2 Up
3 Down
4 Right
Bright Up/Down None

Libraries

.
├── neopixel                - zorxx/neopixel library, uses ESP32 I2S
├── neopixel_display        - my driver for displaying tetris boards on the LED matrix
└── tetris                  - my tetris game logic, 0xjmux/tetris

esp32-neopixel-tetris's People

Contributors

0xjmux avatar

Watchers

 avatar

esp32-neopixel-tetris's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.