So, yes... As per Julian note above... Then... You will need to decide how you want to encode the message going to the arduino. If only ever to one pin then you can just send a 0 or 1 etc. But if you want to talk to more pins then... It gets more interesting :-)
You could send the pin number, value - or a string of 0s and 1s to represent values, or encode them all into a single number where each binary bit represents a pin... All good fun.
(Must admit I tend to go for something simple like just the pin number and the value and don't use pins above 9 so it's only one character long, so first char is the pin and second is 0 or 1.). So "41" is turn on pin 4. But of course half the fun is making it up as you go..