Static IP Wifi Shield

I have this code and i want to have static ip adress to my wifi shield.There is anyone to help me, please?My lack experience of programming didn’t let me to fix myself.Thanks to all, in advance.

// Robot controlled by a PS3 controller using Arduino Uno and Wifi Shield

//Include the necessary libraries.
#include <SPI.h>
#include <WiFi.h>
#include <WiFiUdp.h>

//Wifi Variables
int status = WL_IDLE_STATUS;
char ssid = “YOURSSID”; // your network SSID (name)
char pass = “YOURPASS”; // your network password (use for WPA, or use as key for WEP)
int keyIndex = 0; // your network key Index number (needed only for WEP)

unsigned int localPort = 2390; // local port to listen on

char packetBuffer[255]; //buffer to hold incoming packet

WiFiUDP Udp;

// Motor Control Variables
int PWM1 = 9;
int ENABLE1 = 8;
int PWM2 = 5;
int ENABLE2 = 1;
int PWM3 = 3;
int ENABLE3 = 0;
int PWM4 = 6;
int ENABLE4 = 2;

int lX, lY, rX, rY;

void setup(){

//IF YOU WANT TO TEST YOUR SHIELD AND SEE INFORMATION ON THE SERIAL MONTIOR,
//UNCOMMENT THE FOLLOWING FUNCTION.
//IF YOU WANT TO RUN THE MOTORS, COMMENT IT OUT AGAIN.
//Serial.begin(9600);

//Set pinMode for the enable pins
pinMode (ENABLE1, OUTPUT);
pinMode (ENABLE2, OUTPUT);
pinMode (ENABLE3, OUTPUT);
pinMode (ENABLE4, OUTPUT);

//UDP Configuration
// check for the presence of the shield:
if (WiFi.status() == WL_NO_SHIELD) {
Serial.println(“WiFi shield not present”);
// don’t continue:
while(true);
}

// attempt to connect to Wifi network:
while ( status != WL_CONNECTED) {
Serial.print("Attempting to connect to SSID: ");
Serial.println(ssid);
// Connect to WPA/WPA2 network. Change this line if using open or WEP network:
status = WiFi.begin(ssid,pass);

// wait 10 seconds for connection:
delay(10000);
}
Serial.println(“Connected to wifi”);
//printWifiStatus();

Serial.println("\nStarting connection to server…");
// if you get a connection, report back via serial:
Udp.begin(localPort);
}

void loop() {
// if there’s data available, read a packet
int packetSize = Udp.parsePacket();
if(packetSize)
{
Serial.print("Received packet of size ");
Serial.println(packetSize);
Serial.print("From “);
IPAddress remoteIp = Udp.remoteIP();
Serial.print(remoteIp);
Serial.print(”, port ");
Serial.println(Udp.remotePort());

// read the packet into packetBufffer
int len = Udp.read(packetBuffer,255);
if (len >0) packetBuffer[len]=0;
Serial.println(“Contents:”);
Serial.println(packetBuffer);

char* pch;
pch = strtok (packetBuffer," ");

for(int i = 0; i < 4; i++)
{
if(i == 0) lX = atoi(pch);
if(i == 1) lY = atoi(pch);
if(i == 2) rX = atoi(pch);
if(i == 3) rY = atoi(pch);
pch = strtok (NULL," ");
}
CommandMotors(lY,rY);
}
}

void CommandMotors(int LY, int RY)
{

if(LY < 120) {
digitalWrite (ENABLE1, HIGH);
digitalWrite (ENABLE4, HIGH);
analogWrite(PWM1, (LY-120)-2.125);
analogWrite(PWM4, (LY-120)
-2.125);
}
if(LY > 135) {
digitalWrite (ENABLE1, LOW);
digitalWrite (ENABLE4, LOW);
analogWrite(PWM1, (LY-135)2.125);
analogWrite(PWM4, (LY-135)2.125);
}
if(RY < 120) {
digitalWrite (ENABLE2, HIGH);
digitalWrite (ENABLE3, HIGH);
analogWrite(PWM2, (RY-120)
-2.125);
analogWrite(PWM3, (RY-120)
-2.125);
}
if(RY > 135) {
digitalWrite (ENABLE2, LOW);
digitalWrite (ENABLE3, LOW);
analogWrite(PWM2, (RY-135)*2.125);
analogWrite(PWM3, (RY-135)*2.125);
}

//STOP
if(LY > 120 && LY < 135) {
analogWrite(PWM1, 0);
analogWrite(PWM4, 0);
}
if(RY > 120 && RY < 135) {
analogWrite(PWM2, 0);
analogWrite(PWM3, 0);
}
}

void printWifiStatus() {
// print the SSID of the network you’re attached to:
Serial.print("SSID: ");
Serial.println(WiFi.SSID());

// print your WiFi shield’s IP address:
IPAddress ip = WiFi.localIP();
Serial.print("IP Address: ");
Serial.println(ip);

// print the received signal strength:
long rssi = WiFi.RSSI();
Serial.print(“signal strength (RSSI):”);
Serial.print(rssi);
Serial.println(" dBm");
}

IPAddress ip(192, 168, 1, 177);

look in the arduino examples for more details.