Starting programming with a flow chart

 by rickharris
Fc splash.jpg
Starting to use PIC micro controllers for your projects? they are very useful but very frustrating when your programme just doesn't work.

This is one way to sort out your ideas by drawing a flow chart. This is the way professional programmers often create their masterpieces.

Starting with a simple pencil and paper to get their ideas into some form of order.

This is particularly valuable when the system you are defining is a process that moves step by step.

A good example of the would be programming an automatic washing machine or a robot. Of course for very simple programme you wouldn't need to do this.
 
Remove these adsRemove these ads by Signing Up

Step 1: The symbols

symbols.jpg
For simple flow charting you only need to use 2 symbols.

A rectangle shows an ACTION example - turn say motor on or off, turn an LED on or off.

A diamond shows a DECISION - example - is the switch on, is the lid closed, has the robot touched anything.

Tachyon says: Sep 18, 2010. 9:16 PM
I have to say, this is great. I don't think they even teach flow-charting in CS classes anymore. It's a great way to develop proper code with a logical flow.

It's a lot better than jumping into some object oriented, nonsense that doesn't develop your thought processes. Learn logic and flow first, then screw it all up if you want later.

Nice instructable to introduce people to a dying, but important skill.
rickharris (author) in reply to TachyonSep 19, 2010. 1:08 AM
Thanks for you comment

In general for anything more then trivial playing around some kind of "plan" flow chart or what ever is essential.

No one would expect good results if you started building a house incrementally without any plan to guide you.

What many don't realise is that transferring the flow chart to you preferred programming language is a simple matter provided you know the programming language and its syntax.

A diamond will always be a conditional jump to another part of the programme.

As my example is very simple and only uses 2 symbols all the rectangles are some kind of action - either inputs or outputs. Using the rest of the flow charting symbology breaks these actions down into even smaller steps that can be easily programmed.

People are too impatient these days to take a step that in their minds lengthens the development process.

In actual fact getting things right in the first place (on paper where it is cheap) actually shortens the overall development and ensures that everyone involved understands what is happening.
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!