Start by reading the Arduino Cookbook, it will give you a great incite as to what you want to do and how to do it. This response is to help you get started in solving your problem, not solve it for you.Good Luck & Have Fun!Gil
You won't get much range with that say about 3 mm. For greater range you need an amplifier.What sort of signals do you want to transfer? Is it just a beam breaker? If so seehttp://www.thebox.myzen.co.uk/Hardware/Sneak_Thief.htmlIf not a beam breaker what are you trying to do? Communicate can mean many thingsThe code is simple turn the LED on and off just like in the blink sketch and look at the photo diode with a digital read or analog read depending what pin it is connected to.
I'm not sure how photodiode will be able to read the LED if they're in separate Arduinos