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!!!


mpilchfamily7 months ago
What code are you using and what changes have you made?
vtrguy (author)  mpilchfamily7 months 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)  mpilchfamily7 months 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) 7 months ago
As well, I'm fairly new at this so please forgive me!

Get More Out of Instructables

Already have an Account?


PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!