1 hour delay

Hi,
I want to know how i can make one hour delay :slight_smile:

delay (60UL * 60UL * 1000UL);

One way

delay(60UL * 60UL * 1000UL);  //60 minutes each of 60 seconds each of 1000 milliseconds all unsigned longs

As long as you don't want anything else to happen during the hour
There are better ways as in the BlinkWithoutDelay example in the IDE.

Thanks for the quick response.
Do you how can i make arduino to work in sleep mode for 1 hour. I found the library to put it in sleep mode but may maximum for 8 seconds.
thanks in advance :slight_smile:

I found the library to put it in sleep mode but may maximum for 8 seconds.

No, you found a library to put it in sleep mode for approximately 8 seconds.

3600 / 8 = 450

Thx man, you was really really useful ;]

Given the information you have provided @AWOL's post is very useful.

The maximum time an AVR processor can sleep, in the absence of any other hardware, is approximately eight seconds. If you want the processor to sleep for one hour you will put it to sleep approximately 450 times.

Have you seen the Narcoleptic library?
https://code.google.com/p/narcoleptic/

longDelay(60UL60UL1000UL);

void longDelay(long milliseconds)
{
  while(milliseconds > 0)
  {
     if(milliseconds > 8000)
     {
        milliseconds -= 8000;
        Narcoleptic.delay(8000);
     }
     else
     {
       Narcoleptic.delay(milliseconds);
       break;
     }

  }
}

AWOL:

delay (60UL * 60UL * 1000UL);

Oque significa UL ?

Rigles_Maia:
Oque significa UL ?

Unsigned Long