674Views4Replies

Author Options:

PWM control and "off" for arduino IR remote? Answered

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

https://www.instructables.com/id/Control-your-Arduino-with-a-remote/step5/Control-stuff/

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

button1=Low


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

Thanks!

Discussions

What code are you using and what changes have you made?

I've just discovered that using the code with the ON/OFF, if I get a repeat code..
4294967295

It will freeze and not accept any more transmissions. Is there anyway to get rid of that as well?

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");
}
delay(50);
irrecv.resume();


I found this and I've gotten the on/off working, but am still having troubles with adding the fade

0
None
vtrguy

4 years ago

As well, I'm fairly new at this so please forgive me!