Write like a old phone keyboard

Hi there,
I'm trie to program my arduino for write with a normal comand some text, like an old phone.

Ex:
22 = "B"
888 = "V"
66 = "N"
...

I'm using a IR receive so the code of witch number is like 1 is 0x807FB04F, 2 its 0x807F30CF,... , 9 is 0x807F20DF.

For the steps that I only need numbers i'm using that code

if (IR.decode(&resultados)) // have we received an IR signal?

{
switch(resultados.value) {

case 0x807F728D: Serial.println(" 1"); n_1=1; break;
case 0x807FB04F: Serial.println(" 2"); n_1=2; break;
case 0x807F30CF: Serial.println(" 3"); n_1=3; break;
case 0x807F52AD: Serial.println(" 4"); n_1=4; break;
case 0x807F906F: Serial.println(" 5"); n_1=5; break;
case 0x807F10EF: Serial.println(" 6"); n_1=6; break;
case 0x807F629D: Serial.println(" 7"); n_1=7; break;
case 0x807FA05F: Serial.println(" 8"); n_1=8; break;
case 0x807F20DF: Serial.println(" 9"); n_1=9; break;
case 0x807F807F: Serial.println(" 0"); n_1=0; break;
case 0x807FC837: Serial.println(" OK"); menu_1 = 1; break;
default:
Serial.println(" other button ");
}
delay(150);
IR.resume(); // receive the next value
}

Someone can help me?

the code you posted looks pretty conventional, it maps the IR code to a simple decimal value

what is the problem?

intruso:
Hi there,
I'm trie to program my arduino for write with a normal comand some text, like an old phone.

Ex:
22 = "B"
888 = "V"
66 = "N"
...

You mean like when we used to text with a numeric keypad on the old cell phones? Do you want help implementing that?

Try your best and post your results and we can help.

Here is a sketch that does what you want using the serial console. I could have used structs but I thought it might make more sense to you using arrays. You could easily translate it to use the remote:

char curChar;
char prevChar = 'x';
int charCnt = 0;
int maxCnt[] = {1,3,3,3,3,3,3,4,3,4};
char dispChar[10][5] = {"_", "/.@", "ABC", "DEF", "GHI", "JKL", "MNO", "PQRS",
                "TUV", "WXYZ"};

void setup()
{
  Serial.begin(9600);
}

void loop()
{
  if (Serial.available() > 0) 
  {
    curChar = Serial.read();
    if (!isDigit(curChar)) return;
    if (curChar != prevChar) 
    {
      charCnt = 0;
    }
    else
    {  
      charCnt++;
      charCnt %= maxCnt[curChar - '0'];
    }
    prevChar = curChar;
    Serial.print(dispChar[curChar - '0'][charCnt]);
  }
}