Using the Wifly module you can add wireless control to your project. This is possible through the Wifly Webserver. The wifly module simple webserver enables you to host a simple webpage from where you can control your project. To do that, you must follow these steps.
Step 1: Create a Webpage
This can be accomplished using HTML, which is easy to learn. If you are not familiar with it, visit this website for some beginner tutorials. Attached here is the simple webpage i created. When you open the webpage it appears as shown in the image.
Before, copying the HTML code onto your arduino code, edit it by replacing all the speech marks with apostrophes or place a backslash before each speech mark. You can learn more on that here.
Step 2: Setting Up the Wifly Module
In this example you can create a hotspot using the wifly shield or join an already existing wifi hotspot through serial commands or code.
Once you have created the hotspot or joined an already existing wifi hotspot through serial commands upload the following code.
If you want to connect to another wifi network through code, your code will look like this.
Step 4: Execution
Connect an LED to digital pin 3.
Once you have uploaded the code, run the serial monitor and wait for about 5 to 20 seconds to get your IP address.
The waiting time depends on the method you used.
Enter the IP address on your browser and press enter or go, depending on your browser. The HTML page should appear. Control the LED by clicking on or off and then submit or entering on or off on the textbox then click on submit. You will notice that the LED lights up when you submit on and goes off when you submit off.
For more tutorials on the wifly shield visit www.arduino-hacks.com