From Ethernet shield to WIFI Shield - Ardumote

Hello Guys.
I was looking for a way to control my Arduino from my iPhone, and in the search i found the Ardumote app!
They have a great tutorial on how to setup the app to controll an LED, using an Arduino with the Ethernet shield. ( Now the only problem is, that i only have the original Arduino WiFi Shield, and would like to use that.
I have tried to edit the code, using some og the WiFi examples, but with no luck.

Hope some of you clever guys could tell me what i need to edit, and how!
The Example code is here:

/* Ardumote Example code for Arduino IDE 1.0
  * This example code allows an iPhone, iPod, or iPad to control an arduino + ethernet shield (UDP capable) using the Ardumote App;
  * Ardumote can be downloaded from the Apple App Store here:   

  * This code is based on the UDP examples provided on Arduino's website under "Ethernet"
  * By using this code, you take responsibility for any damage it may incur to your software or hardware.  Use at your own risk!
  * This code is in the public domain - feel free to modify or distribute it.
  * This code has been tested on the Wiznet 5100 based Ethernet Shield from Arduino.  Modifications may be needed for other shields.  
  * Please read directions at
  * S. Amin  12/2011

///////////  ARDUMOTE Directions //////////////////////////

On the Ardumote App, create 2 objects:

1)  Press and hold the "+" button and create a TOGGLE button.  Press and hold on the newly created toggle and press "Set Params".  Enter your ethernet shield's IP address, Port # and set the Message to "P6".  This will send a "P6H" when the switch is active, and a "P6L" when it is not active.

2)  Create a slider in the same way.  Press and hold, enter the same network info.  For the message, set it to "PWM".  This will send a message
    of "PWMXXX" where XXX represents our 3 digit slider value (0-255).  

    Thats it!!  Now, set your ethernet shield's network parameters below, upload the code to the arduino, and try it out!
    ** NOTE:  Make sure your iDevice is on the same WiFi network and the selected port is open 


#include <SPI.h>         // for Arduino later than ver 0018
//#include <EthernetUdp.h>   // UDP library from
#include <Ethernet.h>
                         // source: 

//////////  NETWORK INFO  ////////////////

byte mac[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };  //Set your Ethernet Shield's MAC address here - make sure you replace the ZZs with your shield's values!
byte ip[] = { 192,168,1,20 };    // Set your shield's desired IP address here - check your network for configuration details
//byte gateway[] = { 192,168,1,1 };   //if you need to set a gateway IP
//byte subnet[] = { 255,255,255,0 };    // Change this to your subnet address
unsigned int localPort = 7777;      // local port to listen on (set this the same as Port # on Ardumote Params Screen)

IPAddress iPhoneIP(192, 168, 1, 26);  //Set the iPhone/iPod/iPad's IP address to send messages back to Ardumote...
unsigned int iPhonePort = 7777;      //Set the Port # of the message table you configured in Ardumote (default is 7777)...


///////// Pin Assignments /////////////////

int LED_Pin = 6;  //Set LED_Pin to Pin 6 - Place an LED on Pin 6 of your ethernet shield for testing this code


///////////////// UDP Variables  ////////////////// 

// the next two variables are set when a packet is received
//byte remoteIp[4];          // holds received packet's originating IP
//unsigned int  remotePort;   // holds received packet's originating port

// buffers for receiving and sending data
char packBuff[UDP_TX_PACKET_MAX_SIZE]; //buffer to hold incoming packet,


EthernetUDP Udp;

void setup() {
  // More info on Ethernet on Arduino's website:
  // start the Ethernet and UDP:
  Ethernet.begin(mac,ip);   // If you don't need to set your default gateway or subnet manually, use this
//  Ethernet.begin(mac,ip,gateway,subnet);  // Use this line instead if you've manually set all the parameters
  Udp.begin(localPort);    //Setup UDP socket on port defined earlier

  Serial.begin(9600);    //Start Serial Communications with PC
  pinMode(LED_Pin,OUTPUT);    //Designate pin 6 as Output Pin



void loop() 

  int pwmVal;    // Integer that will hold our PWM values for later use
  // if there's data available, read a packet
  int packetSize = Udp.parsePacket(); // note that this includes the UDP header
    packetSize = packetSize - 8;      // subtract the 8 byte header
    Serial.print("Packet size: ");

    // read the packet into packetBuffer and get the senders IP addr and port number,UDP_TX_PACKET_MAX_SIZE);
    Serial.println("Message: ");


 /* PWM - If we move a slider on Ardumote, it sends in a 3 digit value attached to the message of the slider.
     For example, if your message is set to be "PWM" and your slider is halfway set (slider value is 127),
     then your actual sent message will be received as "PWM127".  Therefore, to set the Pin's PWM value, you simply
     extract the last 3 digits of your message and use that as your PWM value (see below):
    // Assuming our packBuff's contents at index values 3-5 are our PWM values, you can convert them to an int using this:
     pwmVal = (packBuff[3] - '0')*100 + (packBuff[4] - '0')*10 + (packBuff[5] - '0');    //Get PWMXXX message, and use XXX to set an int between 0 and 255.
 //////////////////////// Pin 6 (LED_Pin) /////////////////////////////////////       
     if (packBuff[0] = 'P' && packBuff[1]=='W' && packBuff[2]=='M')  // Wait for "PWMXXX" and use XXX as value for PWM 

      analogWrite(LED_Pin,pwmVal);    //Set LED_Pin to PWM Value
      Serial.println("PWM on Pin 6");    //Write notification  


    else if (packBuff[0] = 'P' && packBuff[1]=='6' && packBuff[2]=='H')  // If we get the message "P6H", then set LED_Pin (6) HIGH
      digitalWrite(LED_Pin,HIGH);    //Turn on LED_Pin
      Serial.println("LED ON");    //Write notification 
      Udp.write("LED 6 is ON");    // Send Message back to iPhone

    else if (packBuff[0] = 'P' && packBuff[1]=='6' && packBuff[2]=='L')  // If we get the message "P6L", then set LED_Pin (6) LOW
      digitalWrite(LED_Pin,LOW);    //Turn off LED_Pin
      Serial.println("LED OFF");    //Write notification 
      Udp.beginPacket(iPhoneIP, iPhonePort);
      Udp.write("LED 6 is OFF");    // Send Message back to iPhone

Hope some of you clever guys could tell me what i need to edit, and how!

Well, the first thing that you need to do is to rewrite the WiFi library to support UDP. Once you've done that, the rest will be easy.