um código que escrevi para fazer meus testes:
#include <IRremote.h>
int RECV_PIN = 11;
IRrecv irrecv(RECV_PIN);
decode_results results;
IRsend irsend; //IR_USE_TIMER2 = pin 9 on Mega
unsigned int rawbuf[8] = {12500, 600, 2150, 600, 700, 1950, 600, 8500};
void setup()
{
Serial.begin(9600);
irrecv.enableIRIn(); // Start the receiver
}
void loop() {
if (Serial.read() != -1) {
irsend.sendRaw(rawbuf, 8, 38 /* kHz */);
Serial.println("Fired");
irrecv.enableIRIn(); // Re-enable receiver
}
if (irrecv.decode(&results)) {
Serial.println(results.value, HEX);
command(&results);
irrecv.resume(); // Receive the next value
}
}