Flowcharts
Flowcharts are used in many industries including engineering, physical sciences, and computer programming where a complete understanding of processes or workflows is required. Flowcharts are diagrams that are used to represent these processes or workflows.
Flowcharts illustrate how a process should work. Flowcharts should not require complex, industry-specific terminology or symbols. A flowchart should be easy to understand without having to be an expert in the chosen field.
Flowcharts should show input states, any decisions made, and the results of those decisions. It is important to show the steps that should be taken when the result of a decision is either yes or no.
It is common for programmers to create a first draft of a program in no specific programming language. These language-independent programs are focused on the logic rather than in the syntax and are often called algorithms. A flowchart is a common way to represent an algorithm. An example of a flowchart is shown in the figure.
The figure shows the logic steps in replacing a lightbulb in the flowchart.
Creating a Process Flowchart ?
The sensors and electronics can allow us to connect the physical world to a computing system like a microcontroller. This connection allows us to complete the first step for creation of an IoT solution. First, we sense data from the physical world, then we do something with the data. We either store it, transmit it, or process it. In the digital world, the processing of data is done with software programs. A program is a set of ordered instructions created to accomplish a specific task. Based on that definition, many everyday life activities can be seen as programs.
A basic recipe for bread can be considered as a program (sequence of activities):
- Preheat oven to 375º F. Prepare two 9-inch loaf pans by buttering and lightly flouring.
- Dissolve yeast in warm water. Add sugar, salt, oil, and 3 cups of water.
- Beat until smooth and stir in remaining flour.
- Knead on a floured surface for 8 – 10 minutes.
- Place in greased bowl and let rise for 1 – 2 hours.
- Punch dough down, divide in half and place in loaf pans. Cover and let rise until doubled.
- Bake at 375º F for 30 – 35 minutes.
In this example, the order of the instructions is relevant. The recipe, like a software program, was designed to accomplish a specific task, in this instance, to make bread.
The recipe could have been written in any language; English, Portuguese, Chinese, or Arabic. The only requirement for the language choice is that the person who is to make the bread is able to understand the language. While different languages have different grammar rules and syntax, the recipe logic should not change.
Similarly, computer programs are also a set of ordered instructions created to accomplish a specific task. Also called code, computer programs can be written in several different languages. The syntax and rules vary from language to language but the program’s logic should have little to no change.
Creating a Process Flowchart
Flowcharts are normally used to diagrammatically illustrate the process flow before a computer program is created. In this lab you will create a simple flowchart showing the process used to create a bread.
Go to https://creately.com/. Can You create a sample diagrams of the basic recipe for bread?
Why Learn to Code?
People who can code are becoming more and more valuable in the current job market. While programmers were somewhat limited to desktop application coding in the past, the rise of the IoT is creating new possibilities for programmers. In 1991, Mark Weiser wrote a paper titled “The Computer of the 21st century”. In his paper, he envisioned the future of the IoT described as “specialized elements of hardware and software, connected by wires, radio waves, and infrared, that will be so ubiquitous that no one will notice their presence”. In a world that is becoming increasingly digital, the ubiquitous nature of computing means that software is everywhere. Today, programmers may work on firmware, device drivers, mobile applications, web interfaces, data analysis, and more. These employment areas were all available before, but the IoT has drastically increased the number of available projects and companies.
The networking industry is also driving the need for more programmers required to customize networking and infrastructure. Another benefit of being able to code is that programmers can create their own software tools. Need a specific network filter not available in the market? Maybe a project requires some specific data analysis. This can all be coded by a good programmer.
Computer Languages
Similar to human languages, there are several different computer languages. Some computer languages are better than others at certain types of tasks.
JavaScript, an interpreted computer language, is designed for creating web applications. With JavaScript, a programmer can create web applications that can interact with users and other applications.
Python, another interpreted language, allows for simpler statements. Python is very easy to use, powerful, and versatile and has become the language of choice for many IoT developers. One of the main reasons for Python’s popularity is the developer community; Python developers have created and made available many specific modules that can be imported into any program to immediately lend added functionality.
Blockly is a visual programming language that lets users create programs by connecting blocks, that represent different logic language structures, rather than by writing the actual code. Blockly runs within a web browser and can translate the visually created program as JavaScript, PHP, or Python. An example of Blockly is shown in the figure.
C / C++, a compiled language, is great for creating complex and fast programs but its strict rules and syntax makes it more difficult to develop. Created in the early 70s, C has become one of the most widely used programming languages of all time. The Linux operating system is written in C.
Java is a “write once, run anywhere” (WORA) compiled language. Despite the similar name, Java and JavaScript are unrelated. Java is designed to run on any platform without the need for recompilation. Java based applications require a JVM (Java Virtual Machine) platform installed on the computer. JVM is the environment where the Java-compiled code is executed.