1 What is Blockly?

Blockly Overview

Blockly is an online application that you can access right from your web  browser. However, with Zumi, we will be accessing Blockly from her computer. With Blockly, you can pair to your Zumi as well as program it in three modes:

  • Junior: Simplified block-based coding for beginners.
  • Senior: For intermediate coders who have some familiarity with block coding.
  • Master: Text-based coding in Python for advanced students. This is currently not available. Check back for updates!

Write your code

To write your code, drag blocks from the menus on the left to the workspace in the middle of the page. Connect blocks like puzzle pieces to create a list of commands in a specific order. Remember, code runs from top to bottom; therefore, Zumi will first attempt to do the command at the top and then she will move on to the next one. She will repeat this process until she reaches the last line of your code, which is when she will stop.

As an example, Zumi will first move forward for 1 second at a speed of 40. After she completes that, then she will turn right 90 degrees. Since there are no commands after that, she – and the code (!) – will stop.

To delete blocks, separate what you want to get rid of from your code and drag them to the trashcan in the lower righthand corner. If you want to delete your entire program, you can drag the whole thing to the trashcan.

To see what your program looks like in Python, click on one of the Python language icon on the right side of the workspace.

Make sure you save! You can do this by going to the menu in the upper lefthand corner of the workspace and clicking on “Save”. To open a saved program, go to the same menu and click on “Open…”.
Blockly menu

Run your code

Click on “Run code” in the upper left hand side of your workspace to get your Zumi driving with your code! If you need to stop your Zumi for any reason during its drive, click on “Stop”, which is right next to the “Run code” button.

Blockly menu, run code, and stop


Test Your Knowledge


Review The Key Concepts


Solve The Problem

Scenario: Your autonomous vehicle must drive forward at a safe speed and stop to deliver a package.

Problem: How can you run this program on Zumi using the Blockly application?


Sample Solution

There are many different ways that we can solve the problem listed above. Please watch the following video to review a sample solution completed by Ontario Tech University Engineering Students.

Demo

Code


Common Errors

Errors can also occur while creating a solution to the problem. Please review the video below to view some of the common errors that can occur.

Common Errors Video: Coming Soon.


Connecting The Dots

License

Foundations of programming with Blockly and Zumi Copyright © by Brandon Carson. All Rights Reserved.

Share This Book