Learning IR remote codes. - Using buttons to trigger events

Okay, here is something I'm trying to wrap my head around and not sure how to accomplish.

I have an Ir receiver hooked to pin 11 and I can decode the IR Hex code and display on serial monitor here.

#include <IRremote.h>

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

void setup()
{
  Serial.begin(9600);
  irrecv.enableIRIn(); // Start the receiver
}

void loop() {
  if (irrecv.decode(&results)) {
    Serial.println(results.value, HEX);
    delay(900);
    irrecv.resume(); // Receive the next value
  }
}

What I would like to do is the following...

When a sketch is started, it will wait 15 seconds for any Ir signals to be received.

When a signal (IR Hex code) is received, it will store the first signal as "0", the next as "1", "2" etc through 9"

I would like these to be stored in EEPROM memory as they will be retained when power is restored.

After the initial "learning" mode where the Hex code will be associated with a number, I would then like to use these "number" values for things like turning pins high or setting the time on the RTC. Ideally I would like to be able to hold a button on the remote and this would allow me to set the time on the RTC from the Ir remote in HHMM format.

Any suggestions on code where this has already been done or could you point me in the right direction.

When a sketch is started, it will wait 15 seconds for any Ir signals to be received.

This is easy enough with a while loop checking the time (using millis()). Inside the while loop, deal with any IR data received.

When a signal (IR Hex code) is received, it will store the first signal as "0", the next as "1", "2" etc through 9"

I would like these to be stored in EEPROM memory as they will be retained when power is restored.

I think that you mean it will store the first value (results.value) in the first address, the second value in the next available address, etc. Storing a "0", "1", "2", etc. hardly seems reasonable.

After the initial "learning" mode where the Hex code will be associated with a number, I would then like to use these "number" values for things like turning pins high or setting the time on the RTC.

In loop(), then, a results.value would be looked for in EEPROM. If found, the address would be used to determine the key (there is a one-to-one correspondence, but they are not equal). That key would be used to decide what to do.

Ideally I would like to be able to hold a button on the remote and this would allow me to set the time on the RTC from the Ir remote in HHMM format.

You can get there. Take it one step at a time. Learn how to wait 15 seconds, while still reading the remote.

Then, learn to count the number of codes received.

Then, learn how to store data in EEPROM. Remember that results.value is a long, and will take 4 address in EEPROM to store. You'd be better using EEPROM_writeAnything to store it, rather than trying to extract the bytes from the long yourself, at this stage.

Then, add some code, after the while loop expires, to read the data stored in EEPROM, to confirm that you storing stuff correctly.

Then, in loop(), you can read the EEPROM data until you find a match for the received IR value.

Then, convert the address where that data was stored to a key.

Finally, do what you need to with that key.

The use of functions will greatly organize your code.

Hi, i'm having an issue with a sketch: I am trying to make a playing keyboard with a remote IR control associating any signal to a specific tone.
Now the issue is that after the first signal, the serial port doesn't print any other signal if I press other remote's buttons.
Here's the sketch:
thanks to everybody will try to help me!

#include <pitches.h>
#include <IRremote.h> 

int speakerPin = 3;
int receiver = 2; 
IRrecv irrecv(receiver); 
decode_results results; 
void setup() 
{ 
  Serial.begin(9600); 
  irrecv.enableIRIn();
  pinMode(speakerPin, OUTPUT);
}
void loop() { 
  if (irrecv.decode(&results)) 
  { 
    Serial.println(results.value, HEX); 
    irrecv.resume();
    switch(results.value){

    case 0xFF30CF://DO
      tone(speakerPin, 262, 500);
      break;

    case 0xFF18E7://RE
      tone(speakerPin, 294, 500);

      break;
    case 0xFF7A85://MI
      tone(speakerPin, 330, 500);
      break;

    case 0xFF10EF://FA
      tone(speakerPin, 349, 500);
      break;

    case 0xFF38C7://SOL
      tone(speakerPin, 392, 500);
      break;

    case 0xFF5AA5://LA
      tone(speakerPin, 440, 500);
      break;
    }
    
  }
}

Do tone and IRremote use the same timer and interfere with one another ?

I had the exact same problem. Check this:

Yes, I think that the main issue should be the same timing of tone and IR, but i'm not an expert and I don't know how to solve this problem, and also in the link you showed me I couldn't grasp any suggestion, I tryied to change my sketch by cutting off the pitches' library and swapping the "switch" block with "if" conditional's one. Not yet solved!