PWM control and "off" for arduino IR remote?

I've built a simple IR remote to trigger a led bar using...

As my template. 

All the leds turn on a-okay but I'd like to be able to implement both an "off" function using the same button 

ie. button1=High      

leave on for desired period of time...


I'd like to be able to use a no delay fade in/out as well...

ie. button7= All leds fade in/out until button7=low (using the method above^^)

I've tried plugging in various other parts of code to no avail...

Any help would be greatly appreciated!!!


What code are you using and what changes have you made?
vtrguy (author)  mpilchfamily4 years ago
I've just discovered that using the code with the ON/OFF, if I get a repeat code..

It will freeze and not accept any more transmissions. Is there anyway to get rid of that as well?
vtrguy (author)  mpilchfamily4 years ago
void loop() {
if ((irrecv.decode(&results)) && (results.value==16753245) ) {
if (state == 0) {
state = 1;
digitalWrite(LED, HIGH);
Serial.println("Center - HIGH");
} else {
state = 0;
digitalWrite(LED, LOW);
Serial.println("Center - LOW");

I found this and I've gotten the on/off working, but am still having troubles with adding the fade
vtrguy (author) 4 years ago
As well, I'm fairly new at this so please forgive me!