IR connection

If you want any help, I suggest you indicate what the problem is, how it occurs, and what if anything you have tried.

thanks countrypaul for the answer! I want to turn on 4 led. For example: an arduino send '1': the 2 arduino reads '1' and turn on pin 13. it's impossible?

For example: an arduino send '1': the 2 arduino reads '1' and turn on pin 13. it's impossible?

No. But you have to define how you send a '1' with a phototransistor or TSOP.

Then, you need to define how you receive data with a phototransistor or TSOP, and decide what it was you received.

I think a serial connection (if it is possible) like this, but the RX doesn't receve anything.
my code is this:

void setup(){
  Serial.begin(9600);
  pinMode(13,OUTPUT);
}
void loop(){

  if (Serial.available()>0){

    if(Serial.read()=='2'){
      digitalWrite(13, HIGH);
    
    }
  
  }
}
void setup(){
  Serial.begin(9600);
  pinMode(13,OUTPUT);
}
void loop(){
  digitalWrite(13,HIGH);
  Serial.print('2');
}

If you expect the IR transmitter to know how to do something useful to "send" a '2', I'm afraid you are sadly mistaken.

If you expect the IR receiver to know how to convert a bunch of blinking to a '2', I'm afraid you are sadly mistaken.

You have to make the IR transmitter flash in some specific way, usually modulated on top of a 38 MHz carrier, that means '2'.

You have to make the IR receiver demodulate the data from the 38 MHz carrier, and decode the HIGH/LOW times to determine that they mean '2'.

Thank a lot paulS. How can i do this?

Try the playground. I found this one there - dirt cheap wireless | CHEAP, FAT and OPEN

Yes, something like this! But can turn on 4 different pin with those code?

I see no reason why it couldn't be expanded to do that.

But can turn on 4 different pin with those code?

Depends on what you write the code to do. Given that that project appears to be able to send any data over serial, you could send "1", "two", "Tres" , and "Something A Bit Like Four", and then receive and interpret the data to know which pin to toggle.

Of course, you could make the process easier by judicious choice of what to send.

Ok. Thank a lot. only a question... What is this???:

) 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;

I don't understand what it means... can you help me :disappointed_relieved:?

http://arduino.cc/en/Reference/BitWrite

ok, but i don't understand how i can send different messages... :frowning:

usually modulated on top of a 38 MHz carrier,

sp. "38kHz"

sp. "38kHz"

Hey, I was 80% right.

I test the sketch ant it work, but i don't understand how i can send messages. For example, how do i sent '2'? Help me please... :disappointed_relieved:

I test the sketch ant it work

Which sketch? Define "work". How do you know that it accomplished anything?

but i don't understand how i can send messages. For example, how do i sent '2'?

Just like the sketch demonstrated.

I think it work because the tx board prints ø on serial monitor. But i don' understant how i can send what I want...

I think it work because the tx board prints ø on serial monitor. But i don' understant how i can send what I want...

The code in the link that you say you are following has the sender sending "testing testing testing" every half second. If you are not receiving that, your hardware is not working.