Week 3: Embedded Programming
MicroController DataSheet
The datasheet of RP2040 was gone through, here is the link.
Qpad Assembly
Following the provided soldering tutorial, the Qpad was soldered and assembled.
Soldering the screen
Arduino Pico was then installed via Arduino Boards Manager, following the instructions. After connecting the board named Seeed XIAO RP2040, the assembled Qpad was tested by the provided code with Arduino. Both the screen and LED worked correctly. 404 not found appeared when opening the link with edge browser, fine with other browsers.
Hello World!
Qpad Tetris
SKY WAR
Game Design
Inspired by the tetris game, the SKY WAR game was designed with a similar concept of falling objects and player interaction. The main logic focus on input (six touch pads with definition of press and held) - state (variables record positions, blocks, score, pause, and game-over) - output (render state into pixels on the screen).
It's a game to control plane shooting bullets to fight againts enemies. Q2 - Q5 were used to control the moving direction of the plane, and continuous pressing and moving were enabled. Q1 was used to shoot bullets and Q0 was used to release the master bloom and clear the screen when energy was full. Energy accumelates when the enemies are hit. The game has 5 difficulty levels, and the speed of the enemies, their bullets, and speed of friendly bullets will increase with the level. Cross healing package will be dropped randomly to recover partial health of the plane. Pausing the game is enabled by long pressing Q0, and the game can be resumed by pressing Q0 again. The game will end when the health of the plane is 0.
Game Demo
SKY WAR Demo 1
SKY WAR Demo 2
Communication
Communication between Qpad and the computer is established through a USB connection, when typing "status" in the serial monitor, the status of the plane in the game can be viewed.
Status Communication
AI statement: GPT-6 was used to assist in understanding the structure of the Tetris game code and to support the development of the SKY WAR game. All concepts and design ideas were developed independently. The code was reviewed, modified, and tested to ensure proper functionality and consistency with the intended game design. The final implementation, including the game design, graphics, and gameplay mechanics, was completed independently.