how to flash and led over IR

Hello out ther, I have 5 Arduino and like to try to work with IR.

I wish to know how I can send a command over IR to get and led to flash.

I like this to be so simple as possible. And I like to have it work like this.

Arduino board number 1 will in a loop send a command flash led left pin13, on Arduino board number 5
Arduino board number 2 will in a loop send a command flash led left pin12, on Arduino board number 5
Arduino board number 3 will in a loop send a command flash both led left pin13 and pin12, Arduino board number 5
Arduino board number 4 will in a loop send a command to stop flash led, on Arduino board number 5

Arduino borad number 5 will execute the command giving by one of the nother Arduino´s

If there are any outthere that know how to work with simpel IR and woud give me som help I woud be so happy.

For the 4 Arduino´s I found this code here. From http://www.therobotlab.co.uk/tutorials/ but can I use it?

#define Frequency 38000L // This is the frequency (in Hertz) of the LED
#define IRled 11 // This is the pin the LED is connected to

void setup() {
Serial.begin(2400);

TCCR2A = _BV(WGM21) | _BV(COM2A0);
TCCR2B = _BV(CS20);

OCR2A = (F_CPU/(Frequency*2L)-1);
pinMode(IRled, OUTPUT);

}

void loop()
{
//insert any of your own code in here
}

You might want to try the IRremote library. You will need a receiver module.

You have to decide exactly what you mean by 'flash'.

You should be aware that the receiver can only receive one signal at a time. If two Arduinos send at the same time it is likely that neither message will get through.

I have found this on the net dirt cheap wireless | CHEAP, FAT and OPEN

For the IR transmitter lets say Arduino borad 1

//dirt cheap wireless TX
//generates 38kHz carrier wave on pin 9 and 10
//sends data via TX every 500ms
void setup()
{
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);

// Clear Timer on Compare Match (CTC) Mode
bitWrite(TCCR1A, WGM10, 0);
bitWrite(TCCR1A, WGM11, 0);
bitWrite(TCCR1B, WGM12, 1);
bitWrite(TCCR1B, WGM13, 0);

// Toggle OC1A and OC1B on Compare Match.
bitWrite(TCCR1A, COM1A0, 1);
bitWrite(TCCR1A, COM1A1, 0);
bitWrite(TCCR1A, COM1B0, 1);
bitWrite(TCCR1A, COM1B1, 0);

// No prescaling
bitWrite(TCCR1B, CS10, 1);
bitWrite(TCCR1B, CS11, 0);
bitWrite(TCCR1B, CS12, 0);

OCR1A = 210;
OCR1B = 210;

Serial.begin(2400);
}

void loop()
{
Serial.println("0001");
delay(500);
}

To recive the "0001" on Arduino board 5 I try this but will it work?

//dirt cheap wireless RX
void setup()
{
Serial.begin(2400);
pinMode(13, OUTPUT);
int serialdata = 0;
serialdata = Serial.read();
int led = 12;
}

void loop()
{
// if incoming serial
if (Serial.available() > 0) {
if (serialdata == '0001') {
digitalWrite(led, HIGH);
delay(500);
digitalWrite(led, LOW);
delay(500);
}
}

To recive the "0001" on Arduino board 5 I try this but will it work?

No.

Serial only receives one byte at a time so a serial read can not return a string.

Please post code using the proper tags.