Mobile Nostalgia: PCN Snake on Nokia 5110
The game "Snake" defined a generation. It also happens to be a perfect test in multi-variable array management. The Snake Game on Nokia 5110 leverages the beautiful, high-contrast, indestructible LCD screen from vintage 1990s mobile phones to re-create the frantic arcade action, forcing programmers to understand expanding pointers and 4-way vector movement matrices.

The Hardware SPI Buffer (PCD8544)
The Nokia 5110 uses the PCD8544 Controller Chip, meaning it is NOT I2C.
- It is raw SPI. It requires 5 dedicated pins (
RST, CE, DC, DIN, CLK). - You cannot write a single pixel easily directly to the screen. You must use
<Adafruit_PCD8544.h>. - The library creates an invisible
84x48 pixel bufferinside the Uno's SRAM memory. The Arduino draws the snake arrays inside its own invisible memory matrix first! - The massive
display.display();command forces the SPI bus to blast the entire shadow-image across the wires into the Nokia screen in a fraction of a second, causing the game to visually update!
Managing the Snake Body Array
A snake is not one square; it is an infinitely expanding array of X/Y coordinates.
- You declare a massive matrix:
int bodyX[100]; int bodyY[100];. - As the snake moves "Right", the C++ loop does not simply draw a new square. It mathematically shifts every single element in the array down one slot!
// Shift the entire snake body forward one segment!
for(int i = snakeLength - 1; i > 0; i--) {
bodyX[i] = bodyX[i-1];
bodyY[i] = bodyY[i-1];
}
// Update the brand new head coordinate based on joystick direction!
bodyX[0] = bodyX[0] + speed;
- When the head coordinates violently match the randomly generated
appleX / appleYcoordinates, thesnakeLengthinteger increments from 5 to 6, and a brand new random apple spawn is calculated mathematically!
Console Hardware Base
- Arduino Uno/Nano (Standard 16MHz execution).
- Original Nokia 5110 (PCD8544) SPI Monochrome LCD Screen.
- 4x Tactile Push Buttons or a 2-Axis Joystick.
- A 10K Potentiometer (Crucial! Simply used to adjust the backlight/contrast of the old-school Nokia LCD so the black pixels pop sharply!).