This is the classic snake game on an STM32F303VC6 microcontroller. A 4x4 matrix keypad functions as the input and (ironically) a Nokia 5110 display functions as the output screen.
Pins D8-D11 are used as EXTI interrupt inputs and D12-D15 as GPIO outputs. This way every time a key on the matrix keypad is pressed, we'll have an interrupt which tells us the column as well, and then a 1 is shifted between the 4 output pins to discern which row it was. The LCD works with SPI.
The memory usage is not optimized. The game grid itself takes 252 B of SRAM and the LCD buffer takes 4032 B of ram which is a lot.
I will try to optimize the memory usage by using bitwise operations instead of arrays for the game grid, and I will also try to improve the 5110 LCD library, which you can find on my own github.