Timer

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Timer

Post by jgu1 »

Hi!

Can anybody help me. I want to make a timer, not a wait. I am making a program where I am using Macro´s. But every 5 minute I want to set a flag so I am able to enable a Macro. I have already used one interrupt with timer0.

Is it possible to make a timer witch run wihtout interrupt, and please without C code?

Thanks i advance.

Best regard

Jørgen

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Timer

Post by medelec35 »

Interrupts are used for a timer if your program is required to do other things whilst timing is carried out.

If you want a 5 minute non-interrupt timer, so program justs waits until time period has elapsed then try this way:
http://www.matrixmultimedia.com/mmforum ... =26&t=6967

If it was me and I would like to keep setting a flag every 5 minutes and performing other functions then I would use timer 1, since already using timer 0.
Martin

Albert38
Posts: 23
Joined: Mon Jan 18, 2010 8:40 am
Has thanked: 2 times
Contact:

Re: Timer

Post by Albert38 »

If you already used timer0, you know the frequentie on witch this timer0 works. Just add a counter to it and place the routine you want to run every 5 minutes behind a "if" before this "if" you make a calculation "{LV} = Counter MOD {the number of times your timer0 is run in 5 minutes}" Now the "if" has to go true loop "yes" when the {LV} is 0

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: Timer

Post by jgu1 »

Hi!

Thank you both of you. I will try.

Regard
Jørgen.

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Timer

Post by medelec35 »

Albert38 wrote:If you already used timer0, you know the frequentie on witch this timer0 works.
That is a good point!
You said your already using int0, here is how you can utilise timer 0 to have a 2, 3 and 5 minute timer simultaneously. I have also included a Minute variable to set for how ever minutes you like.
You can also add as many different timers as you like.
Attachments
Different Timings LED Test1.fcf
(8.5 KiB) Downloaded 331 times
Martin

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: Timer

Post by jgu1 »

Thank you Albert38. Very good examble, it works

Regard

Jørgen :P

Post Reply