This is an integration of the Blockly-Duino2 web-editor into the Edrys system, to enable students to program Arduinos collaboratively.
To use it in edrys import the following URL to your course:
https://cross-lab-project.github.io/edrys_module-blockly-duino-v2/index.html
Currently there are two options for the general settings, that you can set in the configuration:
{
"code": "<xml xmlns=\"https://developers.google.com/blockly/xml\">\n <block type=\"controls_repeat\" id=\"K7oc2pEWX**_W;yu~U|X\" x=\"238\" y=\"88\">\n <field name=\"TIMES\">10</field>\n <statement name=\"DO\">\n <block type=\"controls_if\" id=\"=r$MWru{9uYTo[x*(#D}\">\n <next>\n <block type=\"controls_if\" id=\"qiy}cnAM!l%bQ0bbpYO,\"></block>\n </next>\n </block>\n </statement>\n </block>\n</xml>",
"runCommand": "execute",
"board": "arduino_mega"
}
or if you are cunning the crosslab-fork, you can also use the following yaml:
runCommand: execute
board: arduino_mega
code: |-
<xml xmlns="https://developers.google.com/blockly/xml">
<block type="controls_repeat" id="K7oc2pEWX**_W;yu~U|X" x="238" y="88">
<field name="TIMES">10</field>
<statement name="DO">
<block type="controls_if" id="=r$MWru{9uYTo[x*(#D}">
<next>
<block type="controls_if" id="qiy}cnAM!l%bQ0bbpYO,"></block>
</next>
</block>
</statement>
</block>
</xml>
-
The
code
is used to initialize the editor, otherwise an empty project will be presented. -
The
runCommand
is by default set to "execute" it publishes the current Arduino-code, so that for example the with the pyxterm-module, where this topic has to match theexecute
setting. -
board
is optional, if you want to have serial communication then specify a board, supported boards are:arduino_leonardo
arduino_mega
arduino_micro
arduino_nano
arduino_pro8
arduino_pro16
arduino_uno
arduino_yun
lilypad
- Programming Arduino with visually drag and drop code blocks
- Generate fully compatible Arduino source code
- Multiple Arduino boards choice for automatic selection of pin functions
- Interact Arduino board with dozen of sensor blocks
- Load different on-site examples with url parameters
- Keyboard navigation and accessibility helpers
- Theme choice
- Block render choice
- Multi language
- Keyboard navigation
You can enter accessibility mode by hitting Shift + Ctrl + k.
Official documentation: https://developers.google.com/blockly/guides/configure/web/keyboard-nav
Key mapping is customizable by activating 'open key mappings' option.
Some basic commands for moving around are below.
- W: Previous block/field/input at the same level.
- A: Up one level (Field (or input) -> Block -> Input (or field) -> Block -> Stack -> Workspace).
- S: Next block/field/input at the same level.
- D: Down one level (Workspace -> Stack -> Block -> Input (or field) -> Block -> Field (or input)).
- T: Will open the toolbox. Once in there you can moving around using the WASD keys. And insert a block by hitting Enter.
- X: While on a connection hit X to disconnect the block after the cursor.
The cursor controls how the user navigates the blocks, inputs, fields and connections on a workspace. Two different cursors:
- Default Cursor: Allow the user to go to the previous, next, in or out location.
- Basic Cursor: Using the pre order traversal allows the user to go to the next and previous location.
If you want to install it locally, get code from github and open index.html
in your browser.
The prefered way is to put the BlocklyDuino/web folder into a web server and open the url like localhost/index.html for use.
- Open BlocklyDuino and select your Arduino board, your language, your favorite theme + renderer.
- Drag and drop blocks to make an Arduino program.
- Copy all of the source code into an existing or new project in the Arduino IDE.
- Configure your Arduino IDE with the rght board and communication port.
- Press the 'Upload' button in the Arduino IDE to burn the code into a connected Arduino board.
Check changelog here
Sébastien CANET (scanet@libreduc.cc) for this reboot and Electron version.
Fred Lin (@gasolin) for original BlocklyDuino.
Thanks Neil Fraser, Q.Neutron from Blockly https://developers.google.com/blockly/
Thanks Arduino and Seeeduino guys for Arduino and Grove blocks.
The BlocklyDuino project is also inspired by ardublock and modkit
This BlocklyDuino2 project is also inspired by Blockly@rduino, ardublockly, Blocklino and STudio4Education.
Copyright (C) 2020 Sébastien CANET scanet@libreduc.cc & Fred Lin gasolin@gmail.com
- Licensed under the GNU General Public License v3.0 (the "License").
- You may not use this project or any file except in compliance with the License.
- You may obtain a copy of the License at https://www.gnu.org/licenses/#GPL.
Code from Blockly is licensed under the Apache 2.0 license. Code from STudio4Education is licensed under the BSD 3-Clause license.
Google's Blockly is a web-based, visual programming editor. Users can drag blocks together to build programs. All code is free and open source.
The project page is https://developers.google.com/blockly/
Blockly has an active developer forum. Please drop by and say hello. Show us your prototypes early; collectively we have a lot of experience and can offer hints which will save you time.
Help us focus our development efforts by telling us what you are doing with Blockly. The questionnaire only takes a few minutes and will help us better support the Blockly community.
Want to contribute? Great! First, read our guidelines for contributors.
Tools without which nothing would have been possible (and millions of thanks to their creators!) :