Arduino processing UDP packets?

I have the Offical Arduino WiFi shield with completly updated firmware. My goal is to control 4 digital I/O ports on the Arduino using UDP Packets using my computer. I have a python program set up correctly to detect when one of the arrow keys are pressed and send a UDP packets containing a string until the button is let go of on my computer. I will attach my python program. Also yes the UDP packets ARE getting to my Arduino just fine. Now my goal is for once the Arduino recieves the UDP stirng from my laptop I want the Arduino to process them and light up LEDS accordinly. But Idon't know how to process them using If and else statemtns.

My Arduino sketch is posted below and my python program.

Thanks,

UDP.ino (1.88 KB)

RobotControl.py (1.13 KB)

  String packet = Udp.read(packetBuffer, 255);

You are getting the data here, in packetBuffer. You are also creating a String of the number of bytes actually in the packet.

The String is never going to match the integer value 111. If the packet is big enough, it might match "111", though why you want to take action based on the size of the packet is not at all clear.