Programming with Blockly

Program with blocks

Blockly is an open-source programming language mixing visual and text programming. Developed by Google, this language allows you to assemble visual blocks in which text is written. We provide an integration with the Thymio (since version Aseba 1.5):

blockly_first_example.png

Our integration of Blockly natively provides the events available on the Thymio, allowing you to program purely with events. This is a difference with the Scratch integration, which, while providing a similar interface, takes a sequential approach to programming.

Launch Blockly

Up to Aseba 1.5.5

Just plug Thymio to your computer and start "Aseba Studio" by clicking on this icon:

asebastudiothymio.svg

Aseba Studio for Thymio

Once the text programming environment is open, look on the bottom-left corner and click on "Launch Blockly".

start_blockly.png

Since Aseba 1.6

Start Thymio Web Bridge application first by clicking on this icon:

Thymio_web_bridge.png

Thymio Web Bridge

Then, start Thymio Blockly application by clicking on this icon:

thymio_blockly.jpg

Thymio Blockly

It is recommended to use Chrome, Firefox or Safari.

Note that the new Thymio Blockly interface is currently not available for linux. Th older setup is maintained, you have to start Aseba Studio, then start Blockly from the bottom left panel.

The Blockly interface

blockly_interface.png

The Blockly interface is composed of:

  1. A list of categories (event, actuators, LED…) regrouping the blocks
  2. The block selection window (appears only when you click on a category on 1)
  3. The program area, where you drag & drop your blocks and assemble them
  4. The Play and Stop button, which load the program and stop it and the robot
  5. The New, Open and Save As icons
  6. The online documentation and the language selection buttons
  7. The equivalent text program of your Blockly program (only for information, not possible to modify the text in this interface, you have to open your program in Aseba Studio to do so)

How to program

  1. Choose a category (begin with an event)
  2. Choose a block and drag and drop it into the program area
  3. Add other blocks to create groups
  4. Press Play, and that's it!

Here is an example of what a VPL program looks like in Blockly. Both programs correspond to the same behaviour of the robot!

vpl-example.png
blockly-example.png
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License