Introduction
This blog post is dedicated to the first few steps on the way to coding a game using the FRDM K64F mbed microcontroller and a Nokia 5110 LCD display. The aim of this project is to create a fully functioning handheld arcade style game coded in c++. During the course of the project I will be using the mbed server to write, commit and save the code. The microcontroller in question can be found here: https://developer.mbed.org/platforms/FRDM-K64F/
FRDM K64F microcontroller Nokia 5110 LCD display
Constraints
The following are constraints placed on the project to make it fairer on people who might not have access to the same components as others:
- Access to the following materials:
- Joystick
- Nokia 5110 LCD display
- TMP102 Temperature sensor
- On board Accelerometer and Magnometer
- 3mm LED's (Red, green or yellow)
- 1 k-ohm resistors (1206 surface mount package)
- Push buttons
- Slide buttons (Single pole double throw)
- Piezo buzzer
- 10k Potentiometer
- Must be powered by 9V PP3 battery
- Must use a 9V to 5V buck convertor (MC34062 and components)
- Restricted to a double sided PCB board limited to 100mm by 80mm
Game ideas
The first brainstorm came up with multiple ideas, a lot of which would be too complicated to try and implement using the 48x84 pixels on the Nokia LCD. The fact that there are only 4032 pixels to work with and that they are only ever in one of two states (on or off) is the greatest constraint on the complexity of the game. Several ideas I came up with were:
- A reaction timing game.
- Classic arcade games such as snake, pong or pacman.
- An audio based game using the piezo buzzer (This would really on it being able to produce clear tones which is probably not the case).
- A game based on the accelerometer of the microcontroller that would allow the user to tilt the device and roll a ball through levels.
- Having the game "Undertale" 's combat mechanics as inspiration I could create many small minigames.
- A game that involves moving a character with partial vision around and having to navigate through a maze with only a limited area around the user visible.
- A time based game where time only moves forwards int he game when the user moves.
- RPG based games:
- Hack 'n' slash type game that would involve real-time combat (This would probably not be the best when dealing with a pixelated screen).
- A pokemon style game like the originals would be less intensive on the screen and microcontroller but would be difficult to design, again with the pixelated screen being the drawback.
- A top-down exploring style game would be less of a problem in terms of the pixels required on the screen at any one time and could be implemented in one of two ways. Firstly the area around the user could scroll past as the user 'walks' but keep the user int he center of the screen, or alternatively it could be a room or area based system where the user moves around on the screen and when they reach the side it loads in the next area (This would be less impressive but would be easier to implement).
Most of these ideas are highly complex in terms of their algorithms and the time we have to develop it so it would be a good idea to create a simple game like snake as a backup just in case the main game is not completed in time. It will also give me a chance to test with interfacing between the different components of my device. From the kind of game ideas I have come up with, there are some components that would be used in all of them. These are listed below:
- 1 Nokia 5110 LCD display
- 1 Joystick (2 potentiometers and a button during prototyping because the joystick itself does not fit in a breadboard)
- 2 Push to make buttons (button A and button B)
- A Piezo buzzer (and a potentiometer to control volume)
- A Slide button to control power
- Green LED (To display the power state, on or off)