I'm trying to program a RGB strip and I was wondering if there is a way to interrupt the for loop.
Would be something like this
for (i = 0; i < 255; i++) {
if (I push the buttom) {
turn off led
}
}
delay(2000);
for (i = 255; i > 0; i--) {
if (I push the buttom) {
turn off led
}
}
delay(2000);
For some reason and probably I'm not doing something right, doesn't see to work.
Any advice please.
Thanks