jsparrow.uk

Caterpillar Game - Embedded Systems Project
27 June 2022

Caterpillar Game - Embedded Systems Project

For embedded systems, we were tasked with creating software that would interact with external peripherals on a STM32F746G-Discovery Board. We were in pairs, and my partner Denis suggested we make a clone of the famous snake game, using the built in screen and connecting a joystick to the board for input. We also came up with the idea of using a 7Seg display to display the current level of the game, which would increase at fixed intervals once the player had eaten a certain amount of food. We eventually settled on using a keypad instead, which he made a cover overlay for with some paper.

Flow Chart


System flow chart by Denis

The game had 3 states - The main menu screen, the game screen and the gameover screen. Once the player pressed one of the keypad buttons, the game would start. The player then controlled the caterpillar, eating food and growing the caterpillar. If the player accidentally ate their tail, they lost the game and the game over screen would display the score.

The software was written in C, using the discovery board APIs. It was my first serious project in C which was quite daunting, and I never fully got a handle on some of the features, but I’m excited to learn more in the future. Here you can see an architecture diagram showing how all the functions interact with each other:



To test the game before making it work on the discovery board, I also made a CLI version where I could test the fundamentals. The old CLI prototype is included in the github repo here.