Blogger

Delete comment from: Ken Shirriff's blog

Ema said...

I used IRrecvDemo , to decode the codes from my remote. For button "ok" I recieved the code "0XFFE01F".
All worked perfectly. I saved all codes into IRcodes.h file, then I used this file to check weither the codes are correct or not.
They looked fine, and it recognised all buttons from my remote.
But the problem appears when I press the powerOn button from my robot. Then all codes are different.And my program don't work, because the remote control transmits different codes, or is something wrong with the files?
This is my code:
#include
#include

int RECV_PIN = 4;
IRrecv irrecv(RECV_PIN);
decode_results results;

void setup()
{
Serial.begin(9600);
irrecv.enableIRIn(); // Start the receiver
Serial.println("Ready to decode: ");
}

void loop() {
if (irrecv.decode(&results)) {
test(results.value);
irrecv.resume();
}
}

void test(unsigned long var)
{
switch(var)
{
case ok:
Serial.println("OK");
break;
case inainte:
Serial.println("Inainte");
break;
case inapoi:
Serial.println("Inapoi");
break;
case stanga:
Serial.println("Stanga");
break;
case dreapta:
Serial.println("Dreapta");
break;
case zero:
Serial.println("0");
break;
case unu:
Serial.println("1");
break;
case doi:
Serial.println("2");
break;
case trei:
Serial.println("3");
break;
case patru:
Serial.println("4");
break;
case cinci:
Serial.println("5");
break;
case sase:
Serial.println("6");
break;
case sapte:
Serial.println("7");
break;
case opt:
Serial.println("8");
break;
case noua:
Serial.println("9");
break;
case a:
Serial.println("A");
break;
case account:
Serial.println("Account");
break;
case albastru:
Serial.println("Albastru");
break;
case back:
Serial.println("Back");
break;
case canalm:
Serial.println("Canal minus");
break;
case canalp:
Serial.println("Canal plus");
break;
case cinema:
Serial.println("Cinema");
break;
case details:
Serial.println("Details");
break;
case favorites:
Serial.println("Favorites");
break;
case goto:
Serial.println("Goto");
break;
//...
case radio:
Serial.println("Radio");
break;
case rosu:
Serial.println("Rosu");
break;
//...
case repetare:
break;
default:
Serial.print("Don't recognise the button");
Serial.println(results.value);
break;
}
}

As I said, if i run this program, all works perfectly, it recognises all buttons, but when I pres PowerOn button from my robot, then i recieve most of time "Don't recognise the button".
And when I check what codes are recieved,i see different codes.
Instead of this code: 0XFFE01F , for "ok" button,
I recieve this ones:
Don't recognise the button: 4034314555
Don't recognise the button: 4034314555
Don't recognise the button: 4034314555
Don't recognise the button: 255
Don't recognise the button: 255
Don't recognise the button: 4034314555

For "red" button I recieve:
Don't recognise the button: 2318624347
Don't recognise the button: 490562393
Don't recognise the button: 1235919367
Don't recognise the button: 3964794313
Don't recognise the button: 2318624347
Don't recognise the button: 3809758591
Don't recognise the button: 4014358672
Don't recognise the button: 1236334118
Don't recognise the button: 4239130558
Don't recognise the button: 1962577162
Don't recognise the button: 2318624347

Can anyone help with this issue?

Feb 28, 2014, 1:41:17 PM


Posted to A Multi-Protocol Infrared Remote Library for the Arduino

Google apps
Main menu