Go Down

Topic: 5 min of delay (Read 4779 times) previous topic - next topic

ykn

May 22, 2017, 03:59 pm Last Edit: May 22, 2017, 04:12 pm by ykn
hi all,
 i new one with Arduin o, i want to execute the function after a 5min delay.
so how to make 5 min delay.
thanks
like.
if(sensor == 0)
{
  while(1)
  {
    gps();
     delay(2000)
    getltlg();
    delay(1000);
    tracking();
    delay(1000);
    delay of 5 min;
  }
}

ieee488

Look at the included example in the IDE called Digital --> Blink Without Delay


J-M-L

what do you think delay(1000); does ?
Hello - Please do not PM me for help,  others will benefit as well if you post your question publicly on the forums.
Bonjour Pas de messages privés SVP, postez dans le forum directement pour que ça profite à tous

ykn

#3
May 22, 2017, 04:29 pm Last Edit: May 22, 2017, 04:35 pm by ykn
it provides 1 sec delay

ieee488

it provides 1 sec delay
Using delay() is blocking code.

J-M-L

#5
May 22, 2017, 04:37 pm Last Edit: May 22, 2017, 04:39 pm by J-M-L
Using delay() is blocking code.
of course - but he does not need anything else apparently (although once he tested his sensor there is no way to exit his while)
Hello - Please do not PM me for help,  others will benefit as well if you post your question publicly on the forums.
Bonjour Pas de messages privés SVP, postez dans le forum directement pour que ça profite à tous

J-M-L

it provides 1 sec delay
so if you wanted 5 minutes?
Hello - Please do not PM me for help,  others will benefit as well if you post your question publicly on the forums.
Bonjour Pas de messages privés SVP, postez dans le forum directement pour que ça profite à tous

ieee488

of course - but he does not need anything else apparently
That's what he thinks now. :-)
There is always something else. These newbies have grand plans. 

Ashraf_Zolkopli

hi all,
 i new one with Arduin o, i want to execute the function after a 5min delay.
so how to make 5 min delay.
thanks
like.
if(sensor == 0)
{
  while(1)
  {
    gps();
     delay(2000)
    getltlg();
    delay(1000);
    tracking();
    delay(1000);
    delay of 5 min;
  }
}
Hi ykn,

Welcome..

Please use the code tag when posting codes.

delay ( 1000 );  //<----- This is a second delay..

what if ????

delay ( 1000 * 5UL );  // <---- Would this provide a 5 second worth of delay?


Anyway looking forward... Please limit the use of delay in your code... Thank you

J-M-L

That's what he thinks now. :-)
There is always something else. These newbies have grand plans.  
everyone needs a grand plan !!  ;D  :smiley-mr-green:  :smiley-cool:

(you are conceptually right for a solid approach of course)
Hello - Please do not PM me for help,  others will benefit as well if you post your question publicly on the forums.
Bonjour Pas de messages privés SVP, postez dans le forum directement pour que ça profite à tous

ykn

Hi ykn,

Welcome..

Please use the code tag when posting codes.

delay ( 1000 );  //<----- This is a second delay..

what if ????

delay ( 1000 * 5UL );  // <---- Would this provide a 5 second worth of delay?


Anyway looking forward... Please limit the use of delay in your code... Thank you
[ sir i need 5 min delay]

J-M-L

How many milliseconds there are in 5 minutes?
Hello - Please do not PM me for help,  others will benefit as well if you post your question publicly on the forums.
Bonjour Pas de messages privés SVP, postez dans le forum directement pour que ça profite à tous

ykn

i want to write a code for GPS location that send the Latitude and longitude after each 5 min , when the button is pressed.
i am confused how to make 5 min delay.
please suggest me

ykn

delay(1000*60*5);
is it work??

Gabriel_swe

Yes Sir! Or you can do the calculation yourself. 5 minutes is 300 seconds.
delay(300000);

If you want something crazy like 24 hours delay,  you can use delay(86400000);

Go Up