menu


ESE5190 Final Project

Falling Piano Tiles



Introduction

The PIO module on the RP2040 is quite a powerful peripheral, especially in terms of carrying out tasks that require precise timings and GPIO control. These tasks include handling communication protocols such as SPI, I2C, etc. In this project, we have utilized these capabilities of the PIO and the RP2040 as a whole to drive a 640x480 VGA display, and emulate the famous game - Piano Tiles integrated with spatial audio to provide an immersive experience. In the game, the user needs to intercept the falling tiles on the screen using a small base tile that is as the name suggests is present at the bottom of the screen. Each time a tile is intercepted a particular note is played. The spatial audio like effect is created based on which side the user intercepts the tile, i.e. if the tile is intercepted on the left side of the screen, the user will feel that the audio is coming from the left side and vice-versa for the right side. Headphones were used to implement this feature, driven using the PWM peripheral on the RP2040.

The repository containing the code is availabe on GitHub can be accessed by clicking here.

To get a little motivation for diving further into this, let's have a look at the end result.

Working Principle

For a detailed understanding of every component we will look at each of the features incorporated one by one.

Components Required

Block Diagram

Circuit Connections

Firmware

Now let's take a look at the code that's driving our RP2040. Here also, we will split our code overview into smaller sections.