RogerioBoscolo:
So, i just made a few adjustments to use the attachInterrupt but it still not working. =( maybe the problem still in the "delay(WAIT);"
Not maybe. It is the problem.
unsigned long startTime; //add this line before setup()
setup(){
startTime = millis(); //add this line
}
.
.
.
void writeLED1(){
if(millis() - startTime >= WAIT){
analogWrite(red, r);
analogWrite(green, g);
analogWrite(blue, b);
startTime = millis(); //reset startTime for next iteration
}
}