Go Down

Topic: LED-fade without delay (Read 3047 times) previous topic - next topic

VIKTOR72

Feb 18, 2013, 12:46 am Last Edit: Feb 18, 2013, 01:02 am by VIKTOR72 Reason: 1
HI,
Does anybody know how can this sketch example from SoftPWM library be changed,and delay() function be exchanged with blink without delay and how?Or is there some other library with "fade without delay"? I need to do it for two LEDs but not simultaneously,one goes up and stays up for 2sec then goes down and stays down for 2sec.Then other goes up and stays up for 2sec.Thats the loop.


#include <SoftPWM.h>

void setup()
{
 SoftPWMBegin();
 
 SoftPWMSet(13, 0);

 SoftPWMSetFadeTime(13, 1000, 1000);
}

void loop()
{
 SoftPWMSet(13, 255);
 delay(1000);
 SoftPWMSet(13, 0);
 delay(1000);
}

marco_c

Look at my Multi-Blink sketch at the web site in my signature footer below.
Arduino Libraries https://github.com/MajicDesigns?tab=Repositories
Parola for Arduino https://github.com/MajicDesigns/Parola
Arduino++ blog https://arduinoplusplus.wordpress.com

Go Up