Simple Mobile Robot Controller Smartphone and Raspberry Pi

I spent this Saturday doing a fun project: controlling a mobile robot using raspberry pi and smartphone device. I would like to learn about using Raspberry Pi and how to implement a web server on it to enable it being controlled via network.

The tools that I need:
Raspberry Pi with Raspbian installed, and a wifi dongle
a mobile robot platform
motor controller

Actually this is pretty straightforward, so here are the steps:

1. Implement web server on Raspi.
I implemented web server on Raspberry Pi using instruction from this instructables:

2.  Edit the control.php from that instructables at point 1 to control the LED on the motor controller for testing. I added buttons to control GPIO 7 and 8 for the LED. The edited file: Control.php

3. On the RaspPi, Download the python library for the motor controller from this site. I also made a simple function to move the robot forward, so that I can execute it by typing “python” on the shell script at point 4. Here is the code:

4. Update the GPIOServer.h from that instructables I mentioned on point 1 by adding pin 7 and 8 to control the LED and pin 17 to instruct the robot to move forward. This shell script will be run all the time to read the database of the input output that are implemented in point 1 &2.  Once it finishes reading the database, it will echo GPIO pins on the RaspPi. This is the updated code:

And after that, by connecting your smart devices to the RaspPi, you can control the robot. Have FUN!