I try to get 4 LEDs to turn on

Hello, I would like some help, I'm brand new to Arduino, I try to get 4 LEDs to turn on one at a time and continue to be on until I release the remote control button when I press the button I get this code FF629D and FFFFFFFF. Here is the code I use

include "IRremote.h"

int receiver = 11;

IRrecv irrecv(receiver); decode_results results;

void setup() { Serial.begin(9600); irrecv.enableIRIn(); pinMode(6,OUTPUT); pinMode(7,OUTPUT); pinMode(8,OUTPUT); pinMode(9,OUTPUT);


int pin8state = 0; int delayCnt = 0; void loop() { delay(5); delayCnt++; if(delayCnt > 30) { delayCnt=0; digitalWrite(6,LOW); digitalWrite(7,LOW); digitalWrite(8,LOW); digitalWrite(9,LOW); }

if (irrecv.decode(&results)) // have we received an IR signal? { Serial.println(results.value, HEX);

if(results.value == 0xFF629D) { delayCnt = 0; digitalWrite(7,LOW); digitalWrite(8,HIGH);

} if(results.value == 0xFF22DD) { delayCnt = 0; digitalWrite(8,LOW); digitalWrite(7,HIGH);

} if(results.value == 0xFFC23D) { delayCnt = 0; digitalWrite(9,LOW); digitalWrite(6,HIGH);

} if(results.value == 0xFFA857) { delayCnt = 0; digitalWrite(6,LOW); digitalWrite(9,HIGH);

} irrecv.resume(); // receive the next value } }

The "until I release" part of your requirement is NOT possible. The IR device sends a stream of bits when the switch becomes pressed. If the switch is held down, a different stream of bits is sent at periodic intervals. NOTHING happens when the switch is released.

thanks for the answer, it is also what I found out I have tried using the remote from my stereo radio it transmitter D21 and 521 then when I use it, this code works if (results.value == 0xD21) | | results.value == 0x521) the LED lights up untill button is released. so I should probably see in the eyes that I will have to steal the radio remote control, from my wife :-)

UPS the right code is her if(results.value == 0xD21 || results.value == 0x521)