Hi, I want to decode the Samsung AC IrRemote. I am using the Arduino Uno, and using arduino example IRrecvDump
#include <IRremote.h>
int RECV_PIN = 11;
IRrecv irrecv(RECV_PIN);
decode_results results;
void setup()
{
Serial.begin(9600);
irrecv.enableIRIn(); // Start the receiver
}
// Dumps out the decode_results structure.
// Call this after IRrecv::decode()
// void * to work around compiler issue
//void dump(void *v) {
// decode_results *results = (decode_results *)v
void dump(decode_results *results) {
int count = results->rawlen;
if (results->decode_type == UNKNOWN) {
Serial.print("Unknown encoding: ");
}
else if (results->decode_type == NEC) {
Serial.print("Decoded NEC: ");
}
else if (results->decode_type == SONY) {
Serial.print("Decoded SONY: ");
}
else if (results->decode_type == RC5) {
Serial.print("Decoded RC5: ");
}
else if (results->decode_type == SANYO) {
Serial.print("Decoded SANYO: ");
}
else if (results->decode_type == RC6) {
Serial.print("Decoded RC6: ");
}
else if (results->decode_type == PANASONIC) {
Serial.print("Decoded PANASONIC - Address: ");
Serial.print(results->panasonicAddress,HEX);
Serial.print(" Value: ");
}
else if (results->decode_type == JVC) {
Serial.print("Decoded JVC: ");
}
Serial.print(results->value, HEX);
Serial.print(" (");
Serial.print(results->bits, DEC);
Serial.println(" bits)");
Serial.print("Raw (");
Serial.print(count, DEC);
Serial.print("): ");
for (int i = 0; i < count; i++) {
if ((i % 2) == 1) {
Serial.print(results->rawbuf[i]*USECPERTICK, DEC);
}
else {
Serial.print(-(int)results->rawbuf[i]*USECPERTICK, DEC);
}
Serial.print(" ");
}
Serial.println("");
}
void loop() {
if (irrecv.decode(&results)) {
Serial.println(results.value, HEX);
dump(&results);
irrecv.resume(); // Receive the next value
}
}
Following is the output after pressing IR remote button on and off.
FFFFFFFF
Decoded SANYO: FFFFFFFF (0 bits)
Raw (116): -8900 600 -400 600 -1400 600 -400 600 -400 600 -400 600 -400 600 -400 600 -400 600 -400 650 -1350 600 -400 650 -400 550 -1450 550 -1450 550 -450 600 -1400 550 -1450 550 -1450 600 -1400 600 -1400 600 -400 600 -400 600 -400 600 -400 600 -400 650 -350 600 -400 600 -450 600 -400 550 -450 600 -400 600 -400 600 -400 600 -400 600 -400 600 -400 650 -350 650 -400 600 -400 550 -450 550 -450 600 -400 600 -400 600 -400 600 -400 600 -400 600 -400 650 -350 650 -400 550 -450 550 -450 600 -400 600 -400 600 -400 600 -1400 600 -1400 600 -2400 3100
FFFFFFFF
Decoded SANYO: FFFFFFFF (0 bits)
Raw (116): -8850 650 -400 600 -1400 600 -400 600 -400 600 -400 600 -400 600 -400 600 -400 600 -400 650 -1350 650 -350 650 -350 650 -1350 650 -400 600 -400 600 -1400 600 -1400 600 -1400 600 -1400 600 -1400 600 -400 600 -400 600 -400 600 -400 600 -400 650 -350 650 -350 650 -400 600 -400 600 -400 600 -400 600 -400 600 -400 600 -400 600 -400 600 -400 650 -350 650 -350 650 -400 600 -400 600 -400 600 -400 600 -400 600 -400 600 -400 600 -400 650 -350 650 -350 650 -400 600 -400 600 -400 600 -400 600 -1400 600 -1400 600 -1400 600 -1400 600 -2400 3100
i convert the raw data into 0s and 1s. Then i got the following hex
4049F00000000F 16 ON
404DF000000003 16 OFF
4049F00000000F 17 ON
404DF000000003 17 OFF
4049F00000000F 18 ON
404DF000000003 18 OFF
there is no change in raw . I think its long code that . I make the change in Rawbuf.
#define RAWBUF 240 // Length of raw duration buffer
I want to know how i can decode the exact code .Kindly tell me how can i do that..
Thanks