i know AWOL, but what I'm trying to achieve here is that the on time is different with the off time, the implementation if this little exercise have a very really application in the future, i am trying to simplify stuff to the very basic so that i can program in the simplest term and when its time for me to make the project at least i have a good(if any) understanding of how to do it. so would this be better?
const uint8_t Led=13;
boolean LedState=LOW;
unsigned long PreviousMillis=0;
unsigned long TimerOFF=1000;
unsigned long TimerON=100;
void setup()
{
pinMode(Led,OUTPUT);
}
void loop()
{
unsigned long CurrentMillis=millis();
if (LedState==LOW)
{
if (CurrentMillis-PreviousMillis>=TimerON)
{
PreviousMillis=CurrentMillis;
LedState=HIGH;
}
}
else
{
if (CurrentMillis-PreviousMillis>=TimerOFF)
{
PreviousMillis=CurrentMillis;
LedState=LOW;
}
}
digitalWrite(Led,LedState);
}