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.