Mini Arduino Nano gamecomputer
Sometimes certain parts invite you to make a nice application and in this case it was a few analog joysticks in combination with an Arduino Nano and a small OLED screen. All the ingredients to make a small game console. Since the display only needs two connecting wires (I2C) and the analog joysticks need two analog inputs each an Arduino Nano had more than enough pins. The whole can then be powered with four AAA batteries. I have the Arduino Nano and the display in header pins so that they can possibly be replaced or reused themn. This also better than solder directly onthe pins of these components. The Arduino Nano I have is situated in the middle of a bit of experimentation board with both joysticks on either side. To save space I placed the display above the Arduino Nano and then I connected everything to the Arduino and added the power supply line with short wires. For the batteries I bought a ready-made holder with switch, this is handy because then we don't need to place an on and off switch somewhere. This was the whole (simple) hardware design, now it was important to write some software. I had already written a library for the display, so it could be nicely reused and the choice fell on three games that I had already made in the past, snake, pong and breakout. I wrote these games so that they can be played with either one or two people, who can sit opposite each other. Then I wrote an easy choice menu and the game console was ready. The source code of both the library and the games is at the bottom of this page as download. The design and software are not copyrighted (it's GPL) and I hope I can help people with this inspire them to make their own version and, for example, design a nice housing, write new games or improve or supplement the old games. I wish everyone good luck and a lot of fun with this design and at my home the kids had a lot of fun with it. Kind regards,Hein Pragt.
The Arduino Nano is also a very small Arduino board that is especially suitable for use on a breadboard because the connector pins can be put on the bottom side. This makes it easy to plug the board into a breadboard. The board is based on the well-known ATmega328 (Version 3.x) or ATmega168 (Version 2.x). There is no power plug on the board, but there are power input pins. The board can be powered through the Mini-B USB connection, 6 to 12V voltage on the raw input or 5V stabilized power on pin 27. The voltage source will be automatically selected from the best of the three. The Arduino Nano can be programmed via the built-in USB port. The board can be programmed with the standard Arduino programming IDE, you can board and simply select the port from the drop-down menu. The possibilities of the small board are very wide but the design is specially made for use on an experiment board (breadboard).
Oled Display Module for Arduino 0.96 128x64 I2C
The display I used is a fairly standard OLED cheap display with white pixels, a resolution of 128 x 64 pixels and a control by means of I2C by the
the SSD1306 driver IC. This shield also only needs two data lines and it consumes minimal current so that it can also be used in projects that
need to be powered by a battery or battery. The size of this screen is slightly larger than the previous one and measures 26.0 x 15.0 mm. The
module runs on 3v3 and can be connected to the outputs of the 3v3 output of the Arduino, where the I2C lines can simply be connected to the
5V Arduino pins. The I2C address of this OLED shield is 0x3C by default. The screen is very clearly readable due to a very high contrast.
Because it uses 128 x 64 pixels you do not lose more than 1 Kb of valuable sram for this display with the Arduino.
Pins of the 128x64 display
Analoge joysticks voor de Arduino.
An analog joystick is like two potentiometers connected together, one for vertical movement (Y-axis) and another for the horizontal movement (X-axis). So these yield an analog resistance value that can be easily converted into a voltage readable by the analog input pins of the Arduino, The position of the joystick then corresponds to the voltage and will be between 0 and 1023, with 512 being the center point. In addition, there is a pressure switch underneath that can be connected to a a digital pin of the Arduino. In this design I eventually use the analog inputs as digital by converting the voltage into three values, center, left and right, as this is more convenient for programming.
The connections of the two joysticks are on the following pins of the Arduino Nano:
Arduino Nano game console links, files downloads
Last update: 14-05-2022