IRRemote Capture and resend with irsend.sendRaw

I’m attempting to do some simple tests with a Samsung remote + TV.

I’ve seen others that seem to have gotten this to work.

I used the great IR Remote Library and captured the RAW code from the remote. Looks similar to others.

I’ve set up a test pin to blink before transmit which I can see, but the irsend.sendRaw doesn’t appear to do anything.

I must be doing something wrong…

#include <IRremote.h>
#include <IRremoteInt.h>


//Turn Samsung TV on/off repeatedly to test program.
//IR LED connected to pin 3.

unsigned int powerIRout [68] = {4500,4450,650,1600,600,1650,550,1650,
600,500,600,550,550,550,550,550,550,550,600,1600,650,1600,600,
1650,600,500,550,550,550,550,600,550,500,600,550,550,550,1650,
650,500,550,550,550,550,550,600,500,600,500,600,500,1700,650,
500,500,1700,600,1600,650,1600,600,1600,650,1600,600,1600,650};

IRsend irsend;

void setup()
{
  Serial.begin(9600);
  pinMode (3, OUTPUT);  //output used in library
}

void loop() {
     digitalWrite(9,HIGH);   //Set Pin High for testing
     Serial.println("Waiting 500ms");
delay(500);
     digitalWrite(9,LOW);   //Set Pin Low after test
delay(500);
      Serial.println("About to send IR Signal");
      irsend.sendRaw(powerIRout,68,38);    //Sending the integer array above
      //irsend.sendRaw(Signal, sizeof(Signal)/sizeof(int), 38); //AnalysIR Batch Export - RAW  (from arduino forum) 
      Serial.println("Sent");
      Serial.println("Waiting 10 seconds"); 
delay (10000);  // Rest between power cycles
}//end of loop

In case others may find this usefull, here is the pages I used in the about tests http://dduino.blogspot.in/2011/11/use-sonar-to-control-tv.html https://forum.arduino.cc/index.php?topic=265183.0

Ok, well, I think i found out why my array wasn’t lighting up the.

So I switch to a for loop but now my RAW output takes a good 3 seconds to go through the entire array whereby if I press the button on the remote, it’s basically like blip blip and it’s done.

#include <IRremote.h>
#include <IRremoteInt.h>


#include <IRremoteInt.h>


//Turn Samsung TV on/off repeatedly to test program.
//IR LED connected to pin 3.

unsigned int powerIRout[68] = {4500,4450,650,1600,600,1650,550,1650,
600,500,600,550,550,550,550,550,550,550,600,1600,650,1600,600,
1650,600,500,550,550,550,550,600,550,500,600,550,550,550,1650,
650,500,550,550,550,550,550,600,500,600,500,600,500,1700,650,
500,500,1700,600,1600,650,1600,600,1600,650,1600,600,1600,650};

IRsend irsend;

void setup()
{
  Serial.begin(9600);
  pinMode (3, OUTPUT);  //output used in library
}

void loop() {
     digitalWrite(9,HIGH);   //Set Pin High for testing
     Serial.println("Waiting 500ms");
delay(500);
     digitalWrite(9,LOW);   //Set Pin Low after test
delay(500);
      Serial.println("About to send IR Signal");
    for (int i = 0; i < 67; i++)
    {
      irsend.sendRaw(powerIRout, 1, 38); // 38 = kHz
      delay(100);
    }
      Serial.println("Sent");
      Serial.println("Waiting 10 seconds"); 
delay (10000);  // Rest between power cycles
}//end of loop

So my questions are

1) Any idea why the first example the entire array wasn't trasnmistted at all? 2) When I use a loop, it appears to transmit, but it's so slow. 3) If either of those are wrong or other suggestions, I'll gladly accept any assistance :)

I've been able to make any progress on this at all.

When I use the instructions and point to the array with

irsend.sendRaw(powerIRout,68,38);

It doesn't appear to do anything at all

2)

When I use a loop to transmit each place in the array, one by one, it's too slow and takes much longer than when I press the normal remote.

Any ideas?

Hi.

I noticed in the last code you are actually sending the whole array 67 times:

for (int i = 0; i < 67; i++)
   {
     irsend.sendRaw(powerIRout, 1, 38); // 38 = kHz
     delay(100);
   }

to send it byte by byte, try like this:

for (int i = 0; i <= 67; i++)
   {
     irsend.sendRaw(powerIRout[i], 1, 38); // 38 = kHz
     delay(100);
   }