Hallo All
I am testing Flow code(I am experienced C programmer) and are very interested using flow code in future for some projects however
ran into a confusion.
In all the examples there are no main loop as in my attached picture , in simulation and in real hardware this code generated only runs to the end and the micro stop to execute the code as I expected
when using the while loop then the application runs continuously
My question is this correct to use the while loop in Flow code as such and what is the reason that all the examples do not contain a while loop?
Thank you very much for helping gout
While loop
- QMESAR
- Valued Contributor
- Posts: 1287
- Joined: Sun Oct 05, 2014 3:20 pm
- Location: Russia
- Has thanked: 384 times
- Been thanked: 614 times
- Contact:
While loop
- Attachments
-
- 1.png
- Withe Loop
- (7.64 KiB) Downloaded 3006 times
-
- 2.png
- No loop
- (6.07 KiB) Downloaded 3006 times
https://www.flowcodexchange.com/
Regards QMESAR
Regards QMESAR
-
- 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: While loop
Hi QMESAR,
Welcome to Matrix forums.
If you want your hardware to continually work e.g read ADC or inputs, send data to LCD, flash LED's etc then you will need a loop within main.
Without the loop everything just works once then a is automatically inseted by the compiler, so your hardware will be stuck there.
Where you don't have the loops (unless it's a conditional loop) is within call macros, interrupts etc.
So the macro can be entered at the top and be allowed to exit at the bottom.
So if you look at a call macro then you will probably see what you have posted at the bottom, and if its the Main macro then you will probably see what you have posted on top.
Since you're new to flowcode, I would recommend looking in the Learning Centre
Looking at examples like you have been doing.
Martin
Welcome to Matrix forums.
If you want your hardware to continually work e.g read ADC or inputs, send data to LCD, flash LED's etc then you will need a loop within main.
Without the loop everything just works once then a
Code: Select all
Lable: goto Lable
Where you don't have the loops (unless it's a conditional loop) is within call macros, interrupts etc.
So the macro can be entered at the top and be allowed to exit at the bottom.
So if you look at a call macro then you will probably see what you have posted at the bottom, and if its the Main macro then you will probably see what you have posted on top.
Since you're new to flowcode, I would recommend looking in the Learning Centre
Looking at examples like you have been doing.
Martin
Martin
- QMESAR
- Valued Contributor
- Posts: 1287
- Joined: Sun Oct 05, 2014 3:20 pm
- Location: Russia
- Has thanked: 384 times
- Been thanked: 614 times
- Contact:
Re: While loop
Hi Martin
Thank you very much for your help I really appreciate it.I thought it must be in such away however the confirmation from make it 1000 times easier
I like the feel of flow code still have to see how easy it is to handle PWM and input captures in code ,I have the first led counter running in simulation and programmed my
DEV board with the generated hex file and seems to run fine
Have good time
Peter
Thank you very much for your help I really appreciate it.I thought it must be in such away however the confirmation from make it 1000 times easier
I like the feel of flow code still have to see how easy it is to handle PWM and input captures in code ,I have the first led counter running in simulation and programmed my
DEV board with the generated hex file and seems to run fine
Have good time
Peter
https://www.flowcodexchange.com/
Regards QMESAR
Regards QMESAR