I also have a question..and I am a newbie...
I would like to modify the code below to use the 'blink without delay' or "millis()" type code to do the same thing as the code below.
I've been racking my brain for a week on this, any and all help would be appreciated.
int led = 13; // blink 'digital' pin 13 - AKA the built in red LED
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(led, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
digitalWrite(led, HIGH);
delay(10);
digitalWrite(led, LOW);
delay(990);
}
Please note the delay times... for a strobe affect.
rocco34:
it is easy if you think about millis() as a timestamp:
Thanks for laying it out, I get it now...
I needed to get the math right, and that "else if (millis() - startTime < interval)"
line... I was way off with my code.