Setting up bluetooth communication between a smartphone and the Arduino proved surprisingly tricky but there are a few simple steps that will make this much easier. Firstly, you will need to download an app for your smartphone. I used https://play.google.com/store/apps/details?id=com.... but there is probably an iphone equivalent (that you have to pay for ;p )

You may have noticed that the HC05 module has a small switch on it. If you power it up with this switch pressed down it enters AT-mode which means you can interrogate parameters on it and change them if you wish.

Upload the attached sketch to the Mega and set the serial rate on your PC to 9600. Disconnect the power to the HC05 unit and then press the button on it down when you reconnect it. The blinking should now be approximately once every two seconds - now the HC05 is in AT-mode.

Now in the serial monitor we can send commands to the HC05 and see its response. Type "AT" and press send and you should see "OK" come back on the serial monitor - now we know it is listening. The bluetooth name of the device can be changed by typing "AT+NAME=XYZPQR" where XYZPQR is what you want the module to be called. I called mine LightWave. The default passcode for the bluetooth module is 1234 (or 0000) but this can be changed too by sending "AT+PSWD=9876" for example. Finally, we can change the communication rate of the HC05 by sending "AT+UART=38400". This is the default rate for most HC05 modules but mine was set differently so it is good practice to set it to be sure. There are lot's more details about these commands here : https://www.itead.cc/wiki/Serial_Port_Bluetooth_M... and there are also instructables about this step that have much more detail https://www.instructables.com/id/Modify-The-HC-05-...

Now we can try sending commands to the module via a bluetooth device. Firstly disconnect the power to the HC05 module and then reconnect it. You should see that the flashing rate of the LED is much faster - this means it is now waiting to pair. On your smartphone, open the Arduino Bluetooth Controller app and find the HC05 module. If you haven't changed the name it will likely be called HC05 or similar. When given the options of how you would like to connect, select Terminal mode. Now try sending some numbers and text and seeing if the serial monitor on the PC reports that they have been received. Hopefully they have so we can move on, if not there are plenty of instructables that might give you a few hints (https://www.instructables.com/id/Bluetooth-Hc-05-W... for example).

The last thing to do here is to map the controller inputs to numbers the Arduino can do something with. I used the following values:

Up = 1,

Down = 2,

Left = 3,

Right = 4,

Start = 5,

Select = 6.