I downloaded the SoftPWM library and modified the code for my own use, only to find that the SoftPWM function FADE TIME is only 4 SECONDS. The ON time and OFF time work OK, but need to make the FADE time 10 minutes. Anyone have a simple method? Thanks, MAC
Here is the INO CODE:
/*
SoftPWMB FileName:FM_Fading_SoftPWMB.ino
Shows how to fade an LED using the SoftPWM function.
Test Circuit:
LED attached from digital pin 9 to ground.
ShortComings: Only 4 second Up/Down times!
*/
#include <SoftPWM.h>
void setup()
{
SoftPWMBegin();
SoftPWMSet(9, 0);
//fadeuptime & fadedowntime Range: 0 to 4000 only
//First value is pin#
//Second value FadeUp Time 4000ms is 4 seconds
//Third value FadeDown Time 4000ms is 4 seconds
SoftPWMSetFadeTime(9, 4000, 4000);
//This gives 4sec up and 4sec down
}
void loop()
{
SoftPWMSet(9, 255);
//ON TIME duration ms - eg 36000ms is 36seconds
//10hrs is 36,000,000ms
delay(36000000);
SoftPWMSet(9, 0);
//OFF TIME duration ms - eg 48600ms is 48.6seconds
//13.88666hrs is 49,992,000 (about 13hrs & 53.2mins)
//Note: 24 Hrs equals 86,000,000 miliseconds
delay(49992000);
}