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
1 Hour Delay ?
- 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 ?
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
ivorstonker
- Posts: 2
- Joined: Fri Aug 07, 2009 8:12 am