Sending two infrared signals one after another

hi, i'm trying to control my daikin ac (the remotes code is ARC470A1) with arduino. I managed to find the raw IR codes but this time the remote sends two infrared signals one after another. So i tried to replicate that.
Here is my code:

/* rawSend.ino Example sketch for IRLib2
 *  Illustrates how to send a code Using raw timings which were captured
 *  from the "rawRecv.ino" sample sketch.  Load that sketch and
 *  capture the values. They will print in the serial monitor. Then you
 *  cut and paste that output into the appropriate section below.
 */
#include <IRLibSendBase.h>    //We need the base code
#include <IRLib_HashRaw.h>    //Only use raw sender

IRsendRaw mySender;

void setup() {
  Serial.begin(9600);
  delay(2000); while (!Serial); //delay for Leonardo
  Serial.println(F("Every time you press a key is a serial monitor we will send."));
}

#define RAW_DATA_LEN 12
uint16_t rawData[RAW_DATA_LEN]={
	450, 450, 426, 446, 422, 374, 498, 318, 
	554, 442, 426, 1000};

#define RAW_DATA_LENA 100
uint16_t rawDataA[RAW_DATA_LENA]={
	378, 1366, 410, 1326, 410, 1326, 410, 1330, 
	410, 466, 378, 486, 378, 1362, 410, 462, 
	374, 490, 378, 494, 378, 494, 374, 494, 
	378, 490, 378, 494, 378, 494, 374, 494, 
	378, 490, 382, 490, 382, 1358, 414, 454, 
	414, 458, 414, 454, 414, 454, 418, 1326, 
	414, 454, 414, 458, 410, 458, 410, 458, 
	410, 462, 410, 458, 410, 458, 410, 462,
	406, 466, 382, 486, 406, 462, 394, 478, 
	378, 490, 402, 470, 406, 462, 402, 466, 
	382, 490, 378, 494, 378, 490, 378, 1362, 
	378, 490, 378, 1366, 378, 490, 378, 1358, 
	378, 494, 378, 1000};
   
void loop() {
  if (Serial.read() != -1) {
    mySender.send(rawData,RAW_DATA_LEN,38);
    delay(7);
    mySender.send(rawDataA,RAW_DATA_LENA,38);
    Serial.println(F("Sent signal."));
  }
}

But this didn't work so for debuging it i took another arduino and receive the codes. Other arduino only received the first signal but not the second.

Very doubtful. Please explain why you think this.

1 Like

The posted code sends two different signals sequentially, not simultaneously. Why did you choose a delay of only 7 milliseconds between them?

    mySender.send(rawData,RAW_DATA_LEN,38);
    delay(7);
    mySender.send(rawDataA,RAW_DATA_LENA,38);

Sorry for my english. I mean't one after another

Because there needs to be at least 5 ms between the two signals for receiver to separate them.

Try a longer delay.

Better, measure the actual delay used by the official remote and use that.

Please do not edit your original post. It makes the thread difficult or impossible to follow.

Although there was about 10 ms between the two signals on the remote control, I went up to "delay (100)" while trying to make it work and it still didn't work. I think the problem is with the code of the transmitter

Why don't you send it all together? .

Maybe the problem is that you are sending the signal multiple times? It depends on what line endings you have set in the Serial Monitor and what exactly you are transmitting to get the signal to send.

For example if you typed "go" and had line endings set to LF+CR, you are sending 4 characters so you will send the signals 4 times with almost zero wait between the end of the last transmission and the start of the next.

Your code doesn't look valid Daikin signal at all.
It has to start with header, typically 3500, 1750.
Why don't you use some IR library to "recognize" your timings and to send your commands in hex instead of raw??