Page 1 of 1

1 Hour Delay ?

Posted: Fri Aug 07, 2009 9:15 am
by ivorstonker
Hi All,

Im new to Flowcode and have managed to to do some basics ie. flash a LED on a 16f628Pic, but whats the best way to have a 1 Hour delay (or any prolonged dealy)before the LED flashes ?

C Code ?
Loops ?

Any help or example would me much appreciated

Re: 1 Hour Delay ?

Posted: Fri Aug 07, 2009 10:38 am
by Benj
Hello

It depends if you want to be able to do anything during your delay.

If you want to simply do the delay then you can have a delay of say 60 seconds inside a while loop that will run 60 times.

If you want to have slightly more control during the delay then you can either use a smaller delay time and more loop iterations. This way you can include other code into your loops

If you need to completley free up your main running program you could use a timer interrupt and set a flag variable when the hour is over to be processed in your main loop.

Re: 1 Hour Delay ?

Posted: Fri Aug 07, 2009 4:23 pm
by ivorstonker
Hi Benj,

Thanks for the reply, Im going to try the Loop method !