Go Down

Topic: Start up delay (Read 610 times) previous topic - next topic

kengr1

How do I get a delay at the start of the loop? that only happens once. ie I power up the arduino. It waits five seconds before running through loop(). But the five second delay doesnt happen each time it goes through the loop?

Code: [Select]
loop()
{
delay(5000);
}


Gives a five second delay every time the loop is executed, i just want to have it delay just once, at the beginning.

pluggy

Easy, you just put the delay in the setup() part of the sketch.
http://pluggy.is-a-geek.com/index.html

retrolefty


How do I get a delay at the start of the loop? that only happens once. ie I power up the arduino. It waits five seconds before running through loop(). But the five second delay doesnt happen each time it goes through the loop?

Code: [Select]
loop()
{
delay(5000);
}


Gives a five second delay every time the loop is executed, i just want to have it delay just once, at the beginning.


Simply put the 5 second delay command as the last statement of your void setup() section.

Lefty

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy