i made this to control my directv...but i could not figure out what frequency i should use so i made the arduino scan and it worked if i was close by but i think i may have burned out my led.... is there a problem with the code i wrote???
/*
* IRremote: IRsendDemo - demonstrates sending IR codes with IRsend
* An IR LED must be connected to Arduino PWM pin 3.
* Version 0.1 July, 2009
* Copyright 2009 Ken Shirriff
* http://arcfn.com
*/
unsigned int rawCodes[] = {6054,1157,1220,1176,631,564,627,569,1223,572,1232,1162,1216,580,624,1169,629,1165,629};
#include <IRremote.h>
IRsend irsend;
void setup()
{
Serial.begin(9600);
}
void loop() {
if (Serial.read() != -1) {
for (int i = 0; i < 3; i++) {
delay(40);
irsend.sendRaw(rawCodes,32,70); // Scanning...
delay(1000);
irsend.sendRaw(rawCodes,32,71); //
delay(1000);
irsend.sendRaw(rawCodes,32,72); //
delay(1000);
irsend.sendRaw(rawCodes,32,73); //
delay(1000);
irsend.sendRaw(rawCodes,32,74); //
delay(1000);
irsend.sendRaw(rawCodes,32,75); //
delay(1000);
irsend.sendRaw(rawCodes,32,76); //
delay(1000);
irsend.sendRaw(rawCodes,32,77); //
delay(1000);
irsend.sendRaw(rawCodes,32,78); //
delay(1000);
irsend.sendRaw(rawCodes,32,79); //
delay(1000);
irsend.sendRaw(rawCodes,32,80); //
delay(1000);
}
}
}