I have an Arduino project code, but the problem is it has multiple functions and flow of control.

How could I convert this code into flowchart or control flow diagram?

Any software or online website?

closed as off-topic by Juraj, sempaiscuba, VE7JRO, MatsK, gre_gor Feb 15 at 5:37

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question does not appear to be about Arduino, within the scope defined in the help center." – Juraj, sempaiscuba, VE7JRO, MatsK, gre_gor
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    Use doxygen and configure for full control and structure graphs. – Mikael Patel Feb 13 at 12:39
  • 2
    Seems like you should be going the other way - create the flow chart first, then write the code to follow it. – CrossRoads Feb 13 at 14:29
  • Yes flow charts on function call level may be generated with doxygen (calls and callers). More details for instance here, romanegloo.wordpress.com/2012/03/29/… – Mikael Patel Feb 13 at 18:42
  • Another tool to quickly analyze code is Source Monitor. Allows a "statistic" approach to navigating the code. campwoodsw.com/sourcemonitor.html – Mikael Patel Feb 13 at 18:44
  • With respect, how is this a question about Arduino? The same question could be asked about almost any large program in C++. – sempaiscuba Feb 14 at 0:22

Although there are programs who can automatically make some documentation (like doxygen), I haven't seen any software so far that can make USEFUL flowcharts or diagrams. The main reason is that such software does not know which are the important parts and which are not.

To do it manually:

Assuming your code contains multiple files, use an UML (Unified Modeling Language) application. Than if classes are used, you can easily port them to UML, otherwise assume each (.c) file is a 'class'.

By adding properties/fields and methods (functions) and drawing dependencies between the classes/files you get a good idea how everything works together.

  • this is not what he asked. he wants an automatically created flow chart – Juraj Feb 13 at 13:03
  • @Juraj ... true I will update my answer. – Michel Keijzers Feb 13 at 13:26

Not the answer you're looking for? Browse other questions tagged or ask your own question.