1 Hour Delay ?

Any general or miscellaneous queries that do not fit into the other forum catagories

Moderators: Benj, Mods

Post Reply
ivorstonker
Posts: 2
Joined: Fri Aug 07, 2009 8:12 am

1 Hour Delay ?

Post 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

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: 1 Hour Delay ?

Post 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.

ivorstonker
Posts: 2
Joined: Fri Aug 07, 2009 8:12 am

Re: 1 Hour Delay ?

Post by ivorstonker »

Hi Benj,

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

Post Reply