Hi, before starting: sorry for my english
I'm new in this arduino world and I've been working in some simple tasks to understand the functions and stuff...
Now i'm working with a remote control, just turning on and off 3 leds...
The thing is that i want to press the button 4 and that the leds start to blink repeatedly (using a "while"), but I need that pressing the same button this blink stops. The thing is that it seems that arduino doesn't keep receiving signals with the remote when it's inside this while...
I've been reading about doing this with the millis() function... but I think I don't understand everything about this function...
if (results.value == 0xFF10EF) { // the condition when I press the button 4
if (button4 == 0) {
button4 = 1;
}
else if (button4 == 1) {
button4 = 0;
}
while (button4 == 1) {
analogWrite(redled, HIGH);
delay(30);
analogWrite(yelled, HIGH);
delay(30);
analogWrite(greled, HIGH);
delay(30);
analogWrite(redled, LOW);
delay(30);
analogWrite(yelled, LOW);
delay(30);
analogWrite(greled, LOW);
delay(30);
}
}
this is what I've done without millis (because whit millis nothing seemed to work :/)
thanks in advance