In this code:
if (millis() - last1 > 300) {
lightState1 =!lightState1;
digitalWrite(led1,lightState1);
}
last1 = millis();
you are resetting last1 to the current time every time through here, so millis()-last1 will never be greater than 300 (except perhaps the very first time through).
You should do this:
if (millis() - last1 > 300) {
lightState1 =!lightState1;
digitalWrite(led1,lightState1);
last1 = millis();
}
You should do the same for last2 and last3 as well.
Also, at the very end of the code:
}
irrecv.resume();
}
You are calling resume() every time through loop(). I suspect that you should only do that when the library returns a decoded result, in which case you need to put this inside each of the if statements, for example the first one should be this:
if (irrecv.decode(&results) == 0xFF30CF)
{
if (millis() - last1 > 300) {
lightState1 =!lightState1;
digitalWrite(led1,lightState1);
last1 = millis();
}
irrecv.resume();
}
And, again, do a similar thing with the other two if statements.
Pete