I am trying to switch the TV on using Arduino. Following is my set of code
#include <IRremote.h>
IRrecv receiver(2);
IRsend sender;
decode_results results;
long repeatitions;
long count;
unsigned int durations[100];
void (*reset)(void) = 0;
void setup() {
Serial.begin(9600);
receiver.enableIRIn();
}
void loop() {
if (Serial.available()) {
repeatitions = Serial.parseInt();
count = Serial.parseInt();
for (int i =0; i < repeatitions; i++) {
durations[i] = Serial.parseInt();
}
for (int i = 0; i < repeatitions; i++) {
Serial.println("sending code");
sender.sendRaw(durations, count, 40);
delay(50);
}
reset();
}
if (receiver.decode(&results)) {
Serial.println(results.value, HEX);
Serial.print(results.rawlen - 1);
for (int i =1; i <results.rawlen;i++) {
unsigned int number = results.rawbuf[i] * USECPERTICK;
Serial.print(",");
Serial.print(number);
}
Serial.println("");
receiver.resume();
}
}
The code receiving part works fine. And it returned me following code:
A90
25,2400,600,1200,600,600,550,1200,600,600,600,1200,600,600,600,550,600,1200,600,600,600,600,550,650,600,600
But when I try to use the same code to switch the TV on after adding durations to the above returned code it doesn't work. I am entering following into the serial monitor
3,25,2400,600,1200,600,600,550,1200,600,600,600,1200,600,600,600,550,600,1200,600,600,600,600,550,650,600,600
I have attached a screenshot to show how I have installed the IR Transmitter LED.

I have two IR Transmitters. I have tried installing both in same manner 1 by 1. But unfortunately no success.
I am using IRRemote library by Shirriff https://github.com/z3t0/Arduino-IRremote