Hello, im a bit Stuck with a Problem.
I have a Remote:
Power ON/OFF
Mute
Buttons: 1- 6
Volume Down
Volume Up
This is my Code (i DON'T use HEX as my Remote is a NEC Type.
#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 dump(decode_results *results) {
int count = results->rawlen;
Serial.print(results->value); // prints the button code
Serial.println();
if(results->value == 83595375){
Serial.print("Ein/Aus gedrückt");
Serial.println();
}
else if (results->value == 83621895){
Serial.print("Mute Gedrückt");
Serial.println();
}
else if (results->value == 83593335){
Serial.print("Button 1 gedrückt ");
Serial.println();
}
else if (results->value == 83601495){
Serial.print("Button 2 Gedrückt ");
Serial.println();
}
else if (results->value == 83617815){
Serial.print("Button 3 gedrückt ");
Serial.println();
}
else if (results->value == 83591295){
Serial.print("Button 4 gedrückt ");
Serial.println();
}
else if (results->value == 83577015){
Serial.print("Button 5 gedrückt ");
Serial.println();
}
else if (results->value == 83619855){
Serial.print("Button 6 gedrückt ");
Serial.println();
}
else if (results->value == 83581095){
Serial.print("Volume Leise gedrückt ");
Serial.println();
}
else if (results->value == 83587215){
Serial.print("Volume Laut gedrückt ");
Serial.println();
}
}
void loop() {
if (irrecv.decode(&results)) {
dump(&results);
irrecv.resume(); // Receive the next value
} }
Works fine. Later i want to turn on/off led's (relays)
My Question is, if i press and HOLD a button it generates the Code: 4294967295 (Loop Code)
Regardless which Button i press. What i want to do is with the Volume Up/Down Buttons i want to loop the code generated by these dwo buttons when i hold the key down.
But since it does NOT generate a continuous result of 83581095 or 83587215 but it generates the loop code (4294967295 )
What i want, is this
Volume Up:
83587215
83587215
83587215
83587215
83587215
83587215
83587215
83587215
etc....
But it currently does this
Volume Up:
83587215
4294967295
4294967295
4294967295
4294967295
4294967295
4294967295
4294967295
4294967295
Is there any Chance or Trick to keep looping the correct code?
How did you guys do it? Save the first code in EPROM and then if the loop code gets activated read the last entry from the EPROM and writes it each time the loop code is supposed to be on my Serial Monitor? Thats crap....to complicated.
Thank you for the Input
Randy