transfer text with LED and LDR

Hello, I am new to Arduino.
I want to make a program that sends text by blinking an LED and receive the text with a light sensor.

My plan was that if you type in text, the arduino converts it to binary and the binary controls the LED by going on and off.

Is there anyone who as an idea how to do this globally?

Nick

You need to tell us more about the system. How far apart will the LED and photosensor be? Will it be expected to work in ambient light, or only in darkness? What exactly do you mean "globally"?

Maybe a small laser (focussed light) and morse code (slow) will work.
Enter key words in the search box on top of this page.
Leo..

aarg:
You need to tell us more about the system. How far apart will the LED and photosensor be? Will it be expected to work in ambient light, or only in darkness? What exactly do you mean "globally"?

The LED and the photosensor are placed very close to each other, so there is a big difference in value of the photosensor when the LED goes on or off.

with globally i mean which functions i need to program it, because don't really know how to do it

The problem with using LDR as receiver is that LDRs are slow. Hook one up to an ohm meter (resistance mode) and see how long it takes for the resistance to change when light level changes. It's significant. So that means any sending you do will be slow. A photodiode or phototransistor is much faster.

Yeah as above.

Are you using the visible LEDs for show? I mean it is understandable for demo purposes.

A phototransistor and a suitable similar wavelength laser would be fine...if you do not need to see the light, IR LEDs have a good range.

As far as globally...umm...not entirely sure what you mean?

The project is well within beginner-intermediate sort of experience.

Start with just getting an LED to flash:
Blink
Blink (No use of delay())

The move on to Serial I/O:

You could just use a transistor on the serial Tx Line with an LED maybe try at 300 baud to start with.

Yes, i want to use a visible LED for show and thanks for the idea of using a phototransistor, I will buy one.

I already got the Blink working but I don't really know how to do the rest, I tought i needed the Bitmask function but I don't know more than that

Nick