The Project will require the following files and libraries to be loaded before it will compile and run. The code is unique and built around the capability of the libraries, the hardware, some custom graphics and other projects that I've borrowed from.

Please Note: Development of the code for this project has used IDE v1.06 and some of the required libraries are dated. This means some people are having issues with the new IDE version 1.6 and above when loading code. Therefore in the interests of simplicity, I recommend people use IDE v1.06 and have included the correct version library files in zip files at the bottom of step 4 of the instructable.





1. Arduino IDE

I have been using an earlier version of the Arduino IDE, therefore in the interests of simplicity, I recommend that you download Arduino IDE version 1.06 on your desktop machine before you install the code. You can get his version from here.

2. Libraries

These need to be downloaded and added to the IDE (Integrated Development Environment) that runs on your computer, used to write and upload computer code to the physical board.

UTFT.h and URtouch.h located in zip file below

Time.h located in zip file below

DS1307RTC.h located in zip file below

Wire.h and EEPROM.h are already included in IDE V1.06

Credit for UTFT.h and URtouch.h goes to Rinky-Dink Electronics I've included these zip files as it appears the source Website is down.

4. TFT Screen Variations

The vagueries of TFT screens and manufacturers have led to these notes.

(a) Sainsmart - People who have purchased a 3.2' TFT screen that is branded Sainsmart on the back of the TFT device have found they have to modify libraries to resolve display issues. My advice is to avoid these and purchase the same type as displayed in the instructable parts list. If you have purchased a Sainsmart TFT Display already there is a fix below

Edit the file "initlcd.h" and modify the following line from

LCD_Write_COM_DATA(0x01,0x2B3F);

to

LCD_Write_COM_DATA(0x01,0x3B3F);

You will need to restart the IDE and then reload the code to the Arduino.

(b.) TFT Controller Chipset - People who have purchased a 3.2" TFT screen may find they could also have one of two different chipsets "SSD1289" or "ILI9341"

The annoying thing is that it's not easy to distinguish the difference online. The good news is that its easy to fix. If you get a blank screen after loading the code then it's probably because it's an ILI9341 controller. To fix you need to make the following changes to the code.

Edit the code and modify the following line of code from

UTFT myGLCD(SSD1289,38,39,40,41); //Parameters should be adjusted to your Display/Schield model

to

UTFT myGLCD(ILI9341_16,38,39,40,41); //Parameters should be adjusted to your Display/Schield model

Now try reloading the code to the Arduino.

5. Graphics Files

There are a group of bitmap files that I have included below that need to sit in the same subdirectory as the Arduino code when you begin to load into the Arduino. Therefore download the 17 files below and use the IDE to load.

6. Setup the Clock

Once the code has loaded successfully press the center of the screen and this should bring up the setup screen.

Use the menu to set the time and the alarm in 24-hour format.

Press the SAVE button to store the setting.

The RTC has a battery so will retain the correct time even if power has been removed. The Alarm time is stored in EEPROM which means it will be retained if there is a powercut.

7. Testing the Alarm

The Sound module is used to provide the Alarm. The ISD1820 is controlled by the Arduino D8 pin. Sound can be easily added by playing sound into the microphone while simultaneously pushing the record button on the ISD1820. In my case, I recorded the original Pac-Man introduction music from an audio file played through another device.

Once the sound is recorded the recording can be tested by pushing the PLAY-E button which should play the sound through the speaker.

Use the setup menu to set the clock time and the alarm time a few minutes apart. Be sure to "SET" the alarm and push the "SAVE" menu buttons. Once back to the main screen the Alarm should sound when the time occurs.

Turning off the Alarm can be done by pressing the center of the touch screen panel resulting in the Setup Screen.

8. Interacting with the game

V10 of the game has been designed to roughly emulate the original rules. The rules are as follows

Pac-man can be changed to Ms Pac-man by tapping the Pac-man icon in the setup menu

If Pac-Man eats a fruit the Ghost turns blue and can be eaten to score points

If Ghost is red and touches Pac-Man then Ghost gets points

The user can interact with Pac-Man by touching the LHS, RHS, Top Middle or Bottom Middle of the touch screen to issue commands. Pac-Man will only respond to a direction to go in the opposite direction to the way of travel. i.e if going left can be told to go right. If there is enough interest in the project I can add all directions later.

The game scores resets when either Pac-man or the Ghost scores more than 95.

When left alone the characters battle out the scores by randomly wandering through the maze. It's fun to watch and interact.

9. Touch Screen Calibration

Some makers have found that the Buttons on the Setup Screen do not align with the TFT touch controls.

In these cases the Touch Screen needs calibration. This can be easily done by using the Touch Screen Calibration code and instructions provided in the URtouch library. Follow these instructions if you observe this issue.