i followed this guide:
http://luckylarry.co.uk/arduino-projects/arduino-redefining-the-tv-remote/and i have my codes for a Sony TV and the TV doesn't recognize any signals, and ive tried other codes for other DVD players etc. ive confirmed that the IR LED is actually working by using my phone's camera to see the IR. I had the Arduino within inches of the TV so i know its not a range issue.
there are three different IR receiving programs in that library from the link.
one program(IRrecord) will output as raw like:
Received unknown code, saving as raw
m2200 s750 m1050 s750 m450 s750 m1000 s800 m400 s800 m1000 s750 m500 s700 m450 s750 m1050 s750 m450 s750 m450 s750 m450 s700 m500
Then another program(IRrecvDump) in the library outputs it as raw also, but in a different format:
Could not decode message
Raw (26): 16036 2350 -650 1150 -650 550 -650 1150 -650 550 -600 1150 -650 550 -700 500 -650 1150 -650 550 -650 550 -650 500 -700 550
and in the last program(IRrecvDemo) i get the code: A90
and then the code i would use for it would be:
#include <IRremote.h>
IRsend irsend;
void setup()
{
//Serial.begin(9600);
}
void loop()
{
digitalWrite(13,HIGH); //just for status for program
for (int i = 1; i <= 3; ++i)
{
irsend.sendSony(0xa90, 12); // Sony TV power code
//Serial.print(i);
delay(100);
}
digitalWrite(13,LOW); //just for status for program
delay(10000); //wait 10 sec before sending again
}
those all are all pressing the same button...a Sony TV power button on the remote & i got all data through serial monitor...
in the link i posted, the person uses IRrevDump, and he gets something like i did as a raw output, then he removed all the spaces and - signs, and put commas instead so that they can be used in a index:
Raw (26): 16036,2350,650,1150,650,550,650,1150,650,550,600,1150,650,550,700,500,650,1150,650,550,650,550,650,500,700,550
then the code would be like:
#include <IRremote.h>
IRsend irsend;
// just added my own array for the raw signal
unsigned int TvPwr[26] = {
16036,2350,650,1150,650,550,650,1150,650,550,600,1150,650,550,700,500,650,1150,650,550,650,550,650,500,700,550};
void setup()
{
Serial.begin(9600);
}
void loop()
{
digitalWrite(13,HIGH); //just for status for program
irsend.sendRaw(TvPwr,26,38);
delay(100);
irsend.sendRaw(TvPwr,26,38);
delay(100);
irsend.sendRaw(TvPwr,26,38);
digitalWrite(13,LOW);
delay(2000);
}
thanks