Instruction Guide: EV3 - Introduction to FlowCharts

 In this Lesson we have 2 Primary Instruction Resources::

  1. The 1st resource is a EV3 Trainer section on Flowcharts.
  2. The 2nd resource is the EV3 Flowcharts PPT

This lesson introduces students to the concept of flowcharts. Although the level of complexity in the students' programs at this point is still quite low, the introduction of flowcharts at this point affords several benefits:

  • This technique appeals to visual learners as it graphically represents the programming task
  • It forces students to think logically about the entire problem, rather than just jumping in and relying on guess-and-check
  • It creates a "level of abstraction" to allow students to attack the software design problem at a higher level, without getting bogged down (or lost) in the EV3-G details
    • This will become a necessity as their program complexity grows
  • It reinforces the best-practice of "commenting" inside their EV3-G programs, by giving points of correspondence in the flowchart blocks
  • It sets students up for success with incremental/iterative software development (get one block working, then work on the next, combine those two into a working whole, then work on the next....)

The EV3 Trainer Teacher’s Guide has additional reproducibles for those who have purchased the product.The reproducibles for Flowcharts can be found on page 118.

Resource 1:

The EV3 Trainer has a lesson describing Flowcharts:

Final Challenge > Resources > 1

Students should be able to answer the review questions at the end of or the video.

The EV3 Trainer Teacher's Guide references reference Flowcharts in page 118.

(Note: this section is only available in the purchased version of EV3 Trainer)

 

Resource 2:

This first flowchart lesson uses only the start/end, process and decision blocks.

Start by asking student if/when/where they have seen or used flowcharts before:

  • Probe their responses to find preconceptions and commonality with programming flow charts

Walk students through the EV3 Flowcharts PPT presentation:

Slide 1

Display this flow chart and ask students to identify it:

  • If the students did The Flashlight Follower under Differentiated Instruction Material in the Turning lesson, hopefully someone will identify it as a flowchart from  - The Flashlight Follower
  • Step through the flowchart to show that, indeed, this program flow would work for a Flashlight Follower
  • Pay particular attention to the two decision blocks which, by their feedback arrows, create wait loops

Slide 2

Describe the four basics elements of flow charts:

  • Start/End Blocks
    • Every program has a Start Block - on the EV3-G, this corresponds to pressing the center button on the brick to begin running the selected program
    • Some programs do not have an End Block - the Flashlight Follower is a good example, due to it's loop-forever structure, there is no End Block
    • Some programs do have one or more End Blocks - the Dragster Challenge is a good example.
  • Process Blocks
    • These blocks "do something", and once started, go from their beginning to their end without break
  • Decision Blocks
    • These blocks, as their name implies, make a decision:
      • It is always a binary decision, with a yes or no answer
  • Program Flow Arrows give a visual indication of the direction of that the program moves between the blocks

Slide 3

This slide asks students to create a flowchart for the first Engineering Challenge they completed - the Color Activated Dragster

  • This challenge was chosen since it should be memorable for the students, it was a simple (easy to recall) program, and it contained both Decision blocks (wait for...) and Process blocks (move)
  • Ask students to recall what this program looked like with their partner and create a flowchart to describe it

The remainder of this slide walks through the 5 steps in creating a basic flowchart:

  1. Have students break their recollection of the Dragster Challenge into separate behaviors
  2. Have students identify each behavior as a process or decision block
  3. Have students assemble these blocks in order, remembering to label both the blocks and the decision branches (Y/N)
  4. Have students add the program flow arrows
  5. Remind students about the need for Start/End blocks

Have some students share their with flowcharts with the class.

Slide 4

First, step through the flowchart and compare this to the student examples - hopefully you will see some similarities, but the primary goal is illustrate all the elements of a basic flowchart.

Second, the other goal of this slide is to connect the flow chart elements with the EV3-G program elements the students are familiar with:

  • The Start block in a flow chart corresponds to the start element (always present in any EV3-G program) and shows where the program will begin running when the center start button is pressed on the EV3 brick. Every flow chart has a Start block and every EV3-G program has the Start element.

    • The End block of a flow chart may or may not appear in a flow chart (e.g. and a program with an infinite loop may not have a End block). There is no explicit  End element in EV3-G, but a dangling beam after the last block serves this purpose.

      • When a program reaches this dangling beam after the last block of a program, all the motors/sensors shut down and the program stops running.

  • Process blocks consist of one or more programming blocks which execute in order until completed. A single Process block in a flow chart may be implemented by more than one EV3-G block (like the two Move blocks used for "Go Forward" in the example) or just a single EV3-G block (like the Motor block used for "Stop").

  • Decision blocks in a flow chart correspond to some kind of input to the robot (a sensor, input button, timer, etc.), and based on this input the program makes a binary yes-or-no decision. Up to this point, the students have only used sensors for this purpose, so the Decision blocks (in their experience) correspond to Wait-for-Sensor blocks in EV3-G.

Slide 5

There is a key point to be made here about Decision blocks:

  • When a Decision block in a flow chart represents a "Wait-for" loop (such as a Wait-for-Sensor function), one of the binary branches (either Y or N, depending on the design), loops back to the beginning of the decision block to create the "Wait", while the other branch connects to the rest of the program flow (when the "Wait-for" condition has been satisfied). This can be seen in the first example on this slide and in both the flowchart examples earlier in this presentation (since these were based on programs students created using Wait-for-Sensor blocks in EV3-G).

  • Decision blocks may also be used to create two separate program flows which may, or may not, eventually tie back together and also may, or may not, eventually loop back before the same Decision block.

    • The "Parallel Branches" example creates two independent branches

    • The "Merged Parallel Branches" example creates two branches which eventually merge back into one

    • The "Looped Parallel Branches" example imbeds a Merged Parallel structure inside a loop.

  • The key point here for students to realize that Decision block can create many programming possibilities, not just the "Wait-for" loops they have seen. Students have not yet been exposed to the EV3-G blocks which enable these other structures in EV3 Trainer  --but they will soon.

Slide 6

This is an optional slide that shows where these flow chart elements can be found/manipulated in LucidChart.com. Any "dumb" drawing tool (which just draws shapes, but does not understand connection/construction of flowcharts) could be used, but drawing can be slow and changes can be difficult to make. Other flow chart software can also be used, but be sure to try drawing a "Wait-for" in your software before committing to it:

  • Many flowchart programs will not allow a block to feedback onto itself, as you must in a the "Wait-for" structure.
LucidChart.com will give teachers a free education account which will allow you set up separate accounts for each of your teams and have them "share" their folders with you, so you can go paperless with your flowcharts.  The LucidChart basic Flowchart menu is ideal for this lesson:
  • All the elements used in the lesson are on the top line of the menu
  • The drag-and-drop feature provides easy alignment of blocks
  • After dropping a block, labeling is one click away
  • Clicking the output terminal of a block begins drawing the next arrow with a menu for what type of block to place next
  • Decision blocks automatically label the Yes/No branches

The only default setting that is non-ideal is that the arrow-shape defaults to arced, whereas programming flowcharts usually use orthogonal arrows (this change in one extra click).

If you are not using LucidChart, skip this slide and do a live demonstration with your tool-of-choice.

Gliffy is another on line drawing software which support Flow Charts well - including the self-feedback loop.

Assessment

The Introduction to Flowcharts Task Assignment Sheet let students practice these new concepts on an everyday example.

Note: there is no separate EV3-G-based Task Assignment, since students may apply these concepts to EV3-G examples on any subsequent programming lesson challenge.