Snake on ARM

S

Description

  • Michal Ondrejka

  • GitHub

  • december, 2023

In this project I implemented simplified version of the popular snake game to run on ARM. I used C language to make a code and then run it on the microprocessor. Communication with display is via PINs and pressing button generates interrupt that is handled in the code.
The entire project is implemented in a single file named main.c. Necessary macros are defined at the beginning. In the main() function, the SystemConfig() function is called to configure the necessary MCU peripherals. The GameConfig() function is also called to configure the snake, buttons, and timer. Subsequently, the program enters an infinite loop, waiting for interrupts to be generated. Furthermore, the program contains two functions for handling interrupts. The PIT0_IRQHandler() function handles interrupts generated by the timer. In this function, the new position of the snake is determined using the Update() function. The PORTE_IRQHandler() function handles interrupts generated by pressing one of the two buttons. This function changes the direction of the snake's movement.

Technology