Mapping IR remote control to key codes

I have just received this remote control http://dx.com/p/mcu-development-board-21-button-remote-control-1-x-cr2025-132290 to start learning about IR remotes and how they work, how to use them in projects, etc. Just looking for pointers on what to do to give me a kickstart.

  1. Has anyone already mapped the key codes from this or similar remote?
  2. Alternatively, any ideas on an efficient way to get this mapping from first principles?
  3. What is a good library to use for IR remotes assuming that I would like to encapsulate a call to a 'read' function and just get back a code received (like a call to Serial.read())?

Thanks in advance for your for your ideas!

  1. What is a good library to use for IR remotes assuming that I would like to encapsulate a call to a 'read' function and just get back a code received (like a call to Serial.read())?

http://www.arcfn.com/2009/08/multi-protocol-infrared-remote-library.html It will answer your other questions, too.

Thanks. Lots to read!

well, i have got an remote control like this: http://arduino-info.wikispaces.com/IR-RemoteControl how exactly we can declare the code in to the key basically there will be nice if my output will be like: getKey(); if (key == UP){ something[a]=key; a++ } basically i want to use that remote contrl as an arduino keypad and i found it hard to tanslate the codes in the keys and in the same time to define it as a "key" function i have read the Ken`s blog but i cannot found exactly the code i-m looking for someone can example that for me? thank you

The post you link to and the library mentioned in this post should have all the info required for this. It will never be as simple as you show, but the key is to map what is being returned as in the example that you link to:

switch(results.value)  // formatted to be less 'long'
  {
  case 0xFFA25D:      Serial.println(" CH-            ");     break;
  case 0xFF629D:      Serial.println(" CH             ");     break;
  case 0xFFE21D:      Serial.println(" CH+            ");     break;
  case 0xFF22DD:      Serial.println(" PREV           ");     break;
  case 0xFF02FD:      Serial.println(" NEXT           ");     break;
  case 0xFFC23D:      Serial.println(" PLAY/PAUSE     ");     break;
  case 0xFFE01F:      Serial.println(" VOL-           ");     break;
  case 0xFFA857:      Serial.println(" VOL+           ");     break;
  case 0xFF906F:      Serial.println(" EQ             ");     break;
  case 0xFF6897:      Serial.println(" 0              ");     break;
  case 0xFF9867:      Serial.println(" 100+           ");     break;
  case 0xFFB04F:      Serial.println(" 200+           ");     break;
  case 0xFF30CF:      Serial.println(" 1              ");     break;
  case 0xFF18E7:      Serial.println(" 2              ");     break;
  case 0xFF7A85:      Serial.println(" 3              ");     break;
  case 0xFF10EF:      Serial.println(" 4              ");     break;
  case 0xFF38C7:      Serial.println(" 5              ");     break;
  case 0xFF5AA5:      Serial.println(" 6              ");     break;
  case 0xFF42BD:      Serial.println(" 7              ");     break;
  case 0xFF4AB5:      Serial.println(" 8              ");     break;
  case 0xFF52AD:      Serial.println(" 9              ");     break;
  default:     Serial.println(" other button   ");
}

Put this in a function along with reading the IR receiver and instead of the println() return a different 'key value' to your calling program.

thank you i have it done now case [hexcode here]: return key = 'A'; break; case x ... and it`s working all right just for some functions have to be converted from an char to an integer thank you