How to set different delay for multiple outputs at same time

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
Renjith
Posts: 12
Joined: Wed Jul 23, 2014 4:13 am
Has thanked: 2 times
Been thanked: 1 time
Contact:

How to set different delay for multiple outputs at same time

Post by Renjith »

Hi all,

How can I set different delay for 2 or more outputs at same time in flowcode.
Example:
LED1 On and Off every 100ms Delay
LED2 On and Off every 200ms Delay
LED2 On and Off every 300ms Delay

Renjith.

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

Re: How to set different delay for multiple outputs at same

Post by medelec35 »

You can use a timer interrupt to do that.
If you can post a flowchart with your target device selected, then I can modify it to work for you.
You will need to check all configuration settings are correct.
Perhaps a starting place would be to click on my signature link.
If you get stuck then state what version of flowcode you're running (Help About Flowcode).
We can then assist you further.

Martin
Martin

Renjith
Posts: 12
Joined: Wed Jul 23, 2014 4:13 am
Has thanked: 2 times
Been thanked: 1 time
Contact:

Re: How to set different delay for multiple outputs at same

Post by Renjith »

Hi Martin,

Thanks for your prompt replay and advice.
I am just beginner in microcontroller not a licensed user, I need to create some delayed outputs controlled by separate potentiometers, attached herewith the flowcode file which I try to simulate and fail. I hope you understand my requirement. by the way i am working on an another small project use 7 segment display and keypad will post it later for your kind review, please let me know the contact details of Matrix dealer in india for buy some E-Blocks for realise it.

Your kind response is highly appreciated .....

Renjith.
Attachments
Flowcode1.fcfx
(11.19 KiB) Downloaded 225 times

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

Re: How to set different delay for multiple outputs at same

Post by medelec35 »

Sorry,
did not see this post until now.
Will post something soon.

For International dealers take a look Here
Martin

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

Re: How to set different delay for multiple outputs at same

Post by medelec35 »

Hi Renjith,
Here is a version which controls all three outputs independently of each other using a timer interrupt.
It can be done with loops but with interrupts may work better?

Martin
Attachments
Delays V2.fcfx
(14.5 KiB) Downloaded 253 times
Martin

Renjith
Posts: 12
Joined: Wed Jul 23, 2014 4:13 am
Has thanked: 2 times
Been thanked: 1 time
Contact:

Re: How to set different delay for multiple outputs at same

Post by Renjith »

Thanks Martin.. Great idia

Renjith.
Last edited by Renjith on Mon Jul 28, 2014 12:19 am, edited 1 time in total.

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

Re: How to set different delay for multiple outputs at same

Post by medelec35 »

You're welcome.
Just need to bare in mind the simulation times are either much slower or much faster than hardware. It just depends on simulation speed settings

Martin
Martin

Post Reply