Small board.
Big appetite.
Our RP2040 Snake game. Built by students. Ready to play.
01
The connections in your code.
This breadboard illustration uses a generic RP2040 development breakout. Labels show GPIO names, not physical header positions; the real board and module pin order may differ.
ST7789 display · SPI
| SCK | GP18 |
| MOSI | GP19 |
| CS | GP17 |
| RST | GP20 |
| DC | GP21 |
| VCC + BLK | 3V3 rail |
| GND | Ground rail |
MPU6050 · SoftI2C
| SDA | GP15 |
| SCL | GP14 |
| VCC | 3V3 rail |
| GND + AD0 | Ground rail |
AD0 low selects address 0x68. The illustration assumes a 3.3 V compatible breakout with onboard I²C pull-ups. USB supplies the RP2040 development board; its regulated 3V3 and GND feed both rails.
MPU6050 datasheet ↗A tilt-controlled classic.
The physical game runs MicroPython on an RP2040, reads tilt from an MPU6050, and draws on an ST7789 display. This browser adaptation keeps the original 24 × 22 grid, 150 ms movement, colors, scoring, and collision rules.
Same challenge. New controls.
Dragging the board simulates the tilt sensor: tilt right to go right, or tilt up to go up. The strongest tilt axis selects the direction, with a 5° neutral zone. The snake cannot reverse directly into itself. WASD and arrow keys also tilt the board. The direction indicators light up to show the current tilt; they are not clickable controls. Pause and manual restart are added for the web; this is a recreation of the game, not a hardware emulator or an exact model of the physical build.