6. Chapter Tetris
In this chapter, we prepare a tetris game for you. You can play the game by pressing the buttons.
6.1. Project Tetris
Now, let’s use Processing and Raspberry Pi Pico to achieve the tetris game.
6.1.1. Component List
Raspberry Pi Pico x1
|
USB Cable x1
|
|
Breadboard x1
|
||
Push button x4
|
Resistor 10kΩ x4
|
Jumper
|
6.1.2. Circuit
Schematic diagram |
|
Hardware connection. If you need any support, please contact us via: support@freenove.com |
|
Note
To help users have a better experience when doing the projects, we have made some modifications to Pico’s simulation diagram. Please note that there are certain differences between the simulation diagram and the actual board to avoid misunderstanding.
6.1.3. Sketch
6.1.3.1. Sketch Tetris
Use Processing to open Tetris.pde and click Run. If the connection succeeds, it will show as follows:
Now you can try using the buttons to control the falling block. Press the space bar to pause the game.
When the game is over, you can press the space bar to restart the game. Press ESC to exit the game.







