add arduino code generator

This commit is contained in:
Mario
2020-07-23 12:01:42 +02:00
parent c05572a68e
commit 54903fb2e7
23 changed files with 2699 additions and 26 deletions
+61
View File
@@ -0,0 +1,61 @@
import { defineBlocksWithJsonArray } from 'blockly';
import Blockly from 'blockly/core';
defineBlocksWithJsonArray([
// If/else block that does not use a mutator.
{
type: 'control_if',
message0: '%{BKY_CONTROLS_IF_MSG_IF} %1',
args0: [
{
type: 'input_value',
name: 'IF0',
check: 'Boolean'
}
],
message1: '%{BKY_CONTROLS_IF_MSG_THEN} %1',
args1: [
{
type: 'input_statement',
name: 'DO0'
}
],
previousStatement: null,
nextStatement: null,
colour: '#b063c5',
tooltip: '%{BKYCONTROLS_IF_TOOLTIP_2}',
helpUrl: '%{BKY_CONTROLS_IF_HELPURL}',
extensions: ['controls_if_tooltip']
},
{
type: 'controls_ifelse',
message0: '%{BKY_CONTROLS_IF_MSG_IF} %1',
args0: [
{
type: 'input_value',
name: 'IF0',
check: 'Boolean'
}
],
message1: '%{BKY_CONTROLS_IF_MSG_THEN} %1',
args1: [
{
type: 'input_statement',
name: 'DO0'
}
],
message2: '%{BKY_CONTROLS_IF_MSG_ELSE} %1',
args2: [
{
type: 'input_statement',
name: 'ELSE'
}
],
previousStatement: null,
nextStatement: null,
colour: '#b063c5',
tooltip: '%{BKYCONTROLS_IF_TOOLTIP_2}',
helpUrl: '%{BKY_CONTROLS_IF_HELPURL}',
extensions: ['controls_if_tooltip']
}
]);