Merge branch 'master' into development

This commit is contained in:
Mario Pesch 2022-07-05 21:42:35 +02:00
commit f28a8c4fe7
20 changed files with 591 additions and 556 deletions

2
.env
View File

@ -1,4 +1,4 @@
REACT_APP_COMPILER_URL=https://test.compiler.sensebox.de REACT_APP_COMPILER_URL=https://compiler.sensebox.de
REACT_APP_BOARD=sensebox-mcu REACT_APP_BOARD=sensebox-mcu
REACT_APP_BLOCKLY_API=https://api.blockly.sensebox.de REACT_APP_BLOCKLY_API=https://api.blockly.sensebox.de

View File

@ -22,7 +22,4 @@ This project was created with [Create React App](https://github.com/facebook/cre
Ensure that line 14 in [store.js](https://github.com/sensebox/React-Ardublockly/blob/master/src/store.js#L14) is commented out or otherwise you have installed [Redux DevTools Extension](http://extension.remotedev.io/). Ensure that line 14 in [store.js](https://github.com/sensebox/React-Ardublockly/blob/master/src/store.js#L14) is commented out or otherwise you have installed [Redux DevTools Extension](http://extension.remotedev.io/).
## Demo ## Demo
A demo of the current status of the master branch can be accessed via [sensebox-ardublockly.netlify.app](https://sensebox-ardublockly.netlify.app/) :rocket:. A demo of the current status of the master branch can be accessed via [https://blockly-react.netlify.app/](https://blockly-react.netlify.app/) :rocket:.
* [Home](https://sensebox-ardublockly.netlify.app/)
* [Tutorial Overview](https://sensebox-ardublockly.netlify.app/tutorial)
* [Tutorial-Builder](https://sensebox-ardublockly.netlify.app/tutorial/builder)

View File

@ -26,7 +26,7 @@
"markdown-it": "^12.3.2", "markdown-it": "^12.3.2",
"mnemonic-id": "^3.2.7", "mnemonic-id": "^3.2.7",
"moment": "^2.28.0", "moment": "^2.28.0",
"prismjs": "^1.25.0", "prismjs": "^1.27.0",
"react": "^17.0.2", "react": "^17.0.2",
"react-cookie-consent": "^7.2.1", "react-cookie-consent": "^7.2.1",
"react-dom": "^17.0.2", "react-dom": "^17.0.2",

View File

@ -10,23 +10,24 @@
* *
* TODO: maybe change this to a "PIN" BlocklyType * TODO: maybe change this to a "PIN" BlocklyType
*/ */
import Blockly from 'blockly/core'; import Blockly from "blockly/core";
import { selectedBoard } from '../helpers/board' import { selectedBoard } from "../helpers/board";
import * as Types from '../helpers/types' import * as Types from "../helpers/types";
Blockly.Blocks["io_digitalwrite"] = {
Blockly.Blocks['io_digitalwrite'] = {
/** /**
* Block for creating a 'set pin' to a state. * Block for creating a 'set pin' to a state.
* @this Blockly.Block * @this Blockly.Block
*/ */
init: function () { init: function () {
this.setHelpUrl('http://arduino.cc/en/Reference/DigitalWrite'); this.setHelpUrl("http://arduino.cc/en/Reference/DigitalWrite");
this.setColour(250); this.setColour(250);
this.appendValueInput('STATE') this.appendValueInput("STATE")
.appendField(Blockly.Msg.ARD_DIGITALWRITE) .appendField(Blockly.Msg.ARD_DIGITALWRITE)
.appendField(new Blockly.FieldDropdown( .appendField(
selectedBoard().digitalPins), 'PIN') new Blockly.FieldDropdown(selectedBoard().digitalPins),
"PIN"
)
.appendField(Blockly.Msg.ARD_WRITE_TO) .appendField(Blockly.Msg.ARD_WRITE_TO)
.setCheck(Types.BOOLEAN.checkList); .setCheck(Types.BOOLEAN.checkList);
this.setInputsInline(false); this.setInputsInline(false);
@ -40,23 +41,28 @@ Blockly.Blocks['io_digitalwrite'] = {
*/ */
updateFields: function () { updateFields: function () {
Blockly.Arduino.Boards.refreshBlockFieldDropdown( Blockly.Arduino.Boards.refreshBlockFieldDropdown(
this, 'PIN', 'digitalPins'); this,
} "PIN",
"digitalPins"
);
},
}; };
Blockly.Blocks['io_digitalread'] = { Blockly.Blocks["io_digitalread"] = {
/** /**
* Block for creating a 'read pin'. * Block for creating a 'read pin'.
* @this Blockly.Block * @this Blockly.Block
*/ */
init: function () { init: function () {
this.setHelpUrl('http://arduino.cc/en/Reference/DigitalRead'); this.setHelpUrl("http://arduino.cc/en/Reference/DigitalRead");
this.setColour(250); this.setColour(250);
this.appendDummyInput() this.appendDummyInput()
.appendField(Blockly.Msg.ARD_DIGITALREAD) .appendField(Blockly.Msg.ARD_DIGITALREAD)
.appendField(new Blockly.FieldDropdown( .appendField(
selectedBoard().digitalPins), 'PIN'); new Blockly.FieldDropdown(selectedBoard().digitalPins),
this.setOutput(true, 'boolean'); "PIN"
);
this.setOutput(true, "boolean");
this.setTooltip(Blockly.Msg.ARD_DIGITALREAD_TIP); this.setTooltip(Blockly.Msg.ARD_DIGITALREAD_TIP);
}, },
/** @return {!string} The type of return value for the block, an integer. */ /** @return {!string} The type of return value for the block, an integer. */
@ -69,22 +75,27 @@ Blockly.Blocks['io_digitalread'] = {
*/ */
updateFields: function () { updateFields: function () {
Blockly.Arduino.Boards.refreshBlockFieldDropdown( Blockly.Arduino.Boards.refreshBlockFieldDropdown(
this, 'PIN', 'digitalPins'); this,
} "PIN",
"digitalPins"
);
},
}; };
Blockly.Blocks['io_builtin_led'] = { Blockly.Blocks["io_builtin_led"] = {
/** /**
* Block for setting built-in LED to a state. * Block for setting built-in LED to a state.
* @this Blockly.Block * @this Blockly.Block
*/ */
init: function () { init: function () {
this.setHelpUrl('http://arduino.cc/en/Reference/DigitalWrite'); this.setHelpUrl("http://arduino.cc/en/Reference/DigitalWrite");
this.setColour(250); this.setColour(250);
this.appendValueInput('STATE') this.appendValueInput("STATE")
.appendField(Blockly.Msg.ARD_BUILTIN_LED) .appendField(Blockly.Msg.ARD_BUILTIN_LED)
.appendField(new Blockly.FieldDropdown( .appendField(
selectedBoard().builtinLed), 'BUILT_IN_LED') new Blockly.FieldDropdown(selectedBoard().builtinLed),
"BUILT_IN_LED"
)
.appendField(Blockly.Msg.ARD_WRITE_TO) .appendField(Blockly.Msg.ARD_WRITE_TO)
.setCheck(Types.BOOLEAN.compatibleTypes); .setCheck(Types.BOOLEAN.compatibleTypes);
this.setInputsInline(false); this.setInputsInline(false);
@ -98,7 +109,10 @@ Blockly.Blocks['io_builtin_led'] = {
*/ */
updateFields: function () { updateFields: function () {
Blockly.Arduino.Boards.refreshBlockFieldDropdown( Blockly.Arduino.Boards.refreshBlockFieldDropdown(
this, 'BUILT_IN_LED', 'builtinLed'); this,
"BUILT_IN_LED",
"builtinLed"
);
}, },
/** @return {!string} The type of input value for the block, an integer. */ /** @return {!string} The type of input value for the block, an integer. */
getBlockType: function () { getBlockType: function () {
@ -106,18 +120,17 @@ Blockly.Blocks['io_builtin_led'] = {
}, },
}; };
Blockly.Blocks['io_analogwrite'] = { Blockly.Blocks["io_analogwrite"] = {
/** /**
* Block for creating a 'set pin' to an analogue value. * Block for creating a 'set pin' to an analogue value.
* @this Blockly.Block * @this Blockly.Block
*/ */
init: function () { init: function () {
this.setHelpUrl('http://arduino.cc/en/Reference/AnalogWrite'); this.setHelpUrl("http://arduino.cc/en/Reference/AnalogWrite");
this.setColour(250); this.setColour(250);
this.appendValueInput('NUM') this.appendValueInput("NUM")
.appendField(Blockly.Msg.ARD_ANALOGWRITE) .appendField(Blockly.Msg.ARD_ANALOGWRITE)
.appendField(new Blockly.FieldDropdown( .appendField(new Blockly.FieldDropdown(selectedBoard().pwmPins), "PIN")
selectedBoard().pwmPins), 'PIN')
.appendField(Blockly.Msg.ARD_WRITE_TO) .appendField(Blockly.Msg.ARD_WRITE_TO)
.setCheck(Types.NUMBER.compatibleTypes); .setCheck(Types.NUMBER.compatibleTypes);
this.setInputsInline(false); this.setInputsInline(false);
@ -130,7 +143,7 @@ Blockly.Blocks['io_analogwrite'] = {
* @this Blockly.Block * @this Blockly.Block
*/ */
updateFields: function () { updateFields: function () {
Blockly.Arduino.Boards.refreshBlockFieldDropdown(this, 'PIN', 'pwmPins'); Blockly.Arduino.Boards.refreshBlockFieldDropdown(this, "PIN", "pwmPins");
}, },
/** @return {!string} The type of input value for the block, an integer. */ /** @return {!string} The type of input value for the block, an integer. */
getBlockType: function () { getBlockType: function () {
@ -138,88 +151,95 @@ Blockly.Blocks['io_analogwrite'] = {
}, },
}; };
Blockly.Blocks['io_analogread'] = { Blockly.Blocks["io_analogread"] = {
/** /**
* Block for reading an analogue input. * Block for reading an analogue input.
* @this Blockly.Block * @this Blockly.Block
*/ */
init: function () { init: function () {
this.setHelpUrl('http://arduino.cc/en/Reference/AnalogRead'); this.setHelpUrl("http://arduino.cc/en/Reference/AnalogRead");
this.setColour(250); this.setColour(250);
this.appendDummyInput() this.appendDummyInput()
.appendField(Blockly.Msg.ARD_ANALOGREAD) .appendField(Blockly.Msg.ARD_ANALOGREAD)
.appendField(new Blockly.FieldDropdown( .appendField(
selectedBoard().analogPins), 'PIN'); new Blockly.FieldDropdown(selectedBoard().analogPins),
this.setOutput(true, Types.NUMBER.typeId); "PIN"
);
this.setOutput(true, Types.NUMBER.typeName);
this.setTooltip(Blockly.Msg.ARD_ANALOGREAD_TIP); this.setTooltip(Blockly.Msg.ARD_ANALOGREAD_TIP);
}, },
/** @return {!string} The type of return value for the block, an integer. */ /** @return {!string} The type of return value for the block, an integer. */
getBlockType: function () { getBlockType: function () {
return Types.NUMBER.typeId; return Types.NUMBER.typeName;
}, },
/** /**
* Updates the content of the the pin related fields. * Updates the content of the the pin related fields.
* @this Blockly.Block * @this Blockly.Block
*/ */
updateFields: function () { updateFields: function () {
Blockly.Arduino.Boards.refreshBlockFieldDropdown(this, 'PIN', 'analogPins'); Blockly.Arduino.Boards.refreshBlockFieldDropdown(this, "PIN", "analogPins");
} },
}; };
Blockly.Blocks['io_highlow'] = { Blockly.Blocks["io_highlow"] = {
/** /**
* Block for creating a pin state. * Block for creating a pin state.
* @this Blockly.Block * @this Blockly.Block
*/ */
init: function () { init: function () {
this.setHelpUrl('http://arduino.cc/en/Reference/Constants'); this.setHelpUrl("http://arduino.cc/en/Reference/Constants");
this.setColour(250); this.setColour(250);
this.appendDummyInput() this.appendDummyInput().appendField(
.appendField( new Blockly.FieldDropdown([
new Blockly.FieldDropdown([[Blockly.Msg.ARD_HIGH, 'HIGH'], [Blockly.Msg.ARD_LOW, 'LOW']]), [Blockly.Msg.ARD_HIGH, "HIGH"],
'STATE'); [Blockly.Msg.ARD_LOW, "LOW"],
this.setOutput(true, Types.BOOLEAN.typeId); ]),
"STATE"
);
this.setOutput(true, Types.BOOLEAN.typeName);
this.setTooltip(Blockly.Msg.ARD_HIGHLOW_TIP); this.setTooltip(Blockly.Msg.ARD_HIGHLOW_TIP);
}, },
/** @return {!string} The type of return value for the block, an integer. */ /** @return {!string} The type of return value for the block, an integer. */
getBlockType: function () { getBlockType: function () {
return Types.BOOLEAN; return Types.BOOLEAN;
} },
}; };
Blockly.Blocks['io_pulsein'] = { Blockly.Blocks["io_pulsein"] = {
/** /**
* Block for measuring the duration of a pulse in an input pin. * Block for measuring the duration of a pulse in an input pin.
* @this Blockly.Block * @this Blockly.Block
*/ */
init: function () { init: function () {
this.jsonInit({ this.jsonInit({
"type": "math_foo", type: "math_foo",
"message0": Blockly.Msg.ARD_PULSE_READ, message0: Blockly.Msg.ARD_PULSE_READ,
"args0": [{ args0: [
"type": "input_value", {
"name": "PULSETYPE", type: "input_value",
"check": Types.BOOLEAN.compatibleTypes name: "PULSETYPE",
}, { check: Types.BOOLEAN.compatibleTypes,
"type": "field_dropdown", },
"name": "PULSEPIN", {
"options": selectedBoard().digitalPins, type: "field_dropdown",
} name: "PULSEPIN",
options: selectedBoard().digitalPins,
},
], ],
"output": Types.NUMBER.typeId, output: Types.NUMBER.typeName,
"inputsInline": true, inputsInline: true,
"colour": 250, colour: 250,
"tooltip": Blockly.Msg.ARD_PULSE_TIP, tooltip: Blockly.Msg.ARD_PULSE_TIP,
"helpUrl": 'https://www.arduino.cc/en/Reference/PulseIn' helpUrl: "https://www.arduino.cc/en/Reference/PulseIn",
}); });
}, },
/** @return {!string} The type of input value for the block, an integer. */ /** @return {!string} The type of input value for the block, an integer. */
getBlockType: function () { getBlockType: function () {
return Types.NUMBER.typeId; return Types.NUMBER.typeName;
} },
}; };
Blockly.Blocks['io_pulsetimeout'] = { Blockly.Blocks["io_pulsetimeout"] = {
/** /**
* Block for measuring (with a time-out) the duration of a pulse in an input * Block for measuring (with a time-out) the duration of a pulse in an input
* pin. * pin.
@ -227,31 +247,34 @@ Blockly.Blocks['io_pulsetimeout'] = {
*/ */
init: function () { init: function () {
this.jsonInit({ this.jsonInit({
"type": "math_foo", type: "math_foo",
"message0": Blockly.Msg.ARD_PULSE_READ_TIMEOUT, message0: Blockly.Msg.ARD_PULSE_READ_TIMEOUT,
"args0": [{ args0: [
"type": "input_value", {
"name": "PULSETYPE", type: "input_value",
"check": Types.BOOLEAN.compatibleTypes name: "PULSETYPE",
}, { check: Types.BOOLEAN.compatibleTypes,
"type": "field_dropdown", },
"name": "PULSEPIN", {
"options": selectedBoard().digitalPins, type: "field_dropdown",
}, { name: "PULSEPIN",
"type": "input_value", options: selectedBoard().digitalPins,
"name": "TIMEOUT", },
"check": Types.NUMBER.compatibleTypes {
} type: "input_value",
name: "TIMEOUT",
check: Types.NUMBER.compatibleTypes,
},
], ],
"output": Types.NUMBER.typeId, output: Types.NUMBER.typeName,
"inputsInline": true, inputsInline: true,
"colour": 250, colour: 250,
"tooltip": Blockly.Msg.ARD_PULSETIMEOUT_TIP, tooltip: Blockly.Msg.ARD_PULSETIMEOUT_TIP,
"helpUrl": 'https://www.arduino.cc/en/Reference/PulseIn' helpUrl: "https://www.arduino.cc/en/Reference/PulseIn",
}); });
}, },
/** @return {!string} The type of input value for the block, an integer. */ /** @return {!string} The type of input value for the block, an integer. */
getBlockType: function () { getBlockType: function () {
return Types.NUMBER.typeId; return Types.NUMBER.typeName;
} },
}; };

View File

@ -1,57 +1,52 @@
import Blockly, { FieldDropdown } from 'blockly/core' import Blockly, { FieldDropdown } from "blockly/core";
import * as Types from '../helpers/types' import * as Types from "../helpers/types";
import { getColour } from '../helpers/colour'; import { getColour } from "../helpers/colour";
Blockly.Blocks['lists_create_empty'] = { Blockly.Blocks["lists_create_empty"] = {
/** /**
* Elapsed time in milliseconds block definition * Elapsed time in milliseconds block definition
* @this Blockly.Block * @this Blockly.Block
*/ */
init: function () { init: function () {
this.setHelpUrl('http://arduino.cc/en/Reference/Millis'); this.setHelpUrl("http://arduino.cc/en/Reference/Millis");
this.setColour(getColour().arrays); this.setColour(getColour().arrays);
this.appendDummyInput() this.appendDummyInput().appendField("create List with");
.appendField("create List with") this.appendValueInput("NUMBER");
this.appendValueInput('NUMBER');
this.appendDummyInput() this.appendDummyInput()
.appendField("Items of Type") .appendField("Items of Type")
.appendField(new FieldDropdown(Types.VARIABLE_TYPES), 'type'); .appendField(new FieldDropdown(Types.VARIABLE_TYPES), "type");
this.setOutput(true, Types.ARRAY.typeId); this.setOutput(true, Types.ARRAY.typeName);
this.setTooltip(Blockly.Msg.ARD_TIME_MILLIS_TIP); this.setTooltip(Blockly.Msg.ARD_TIME_MILLIS_TIP);
}, },
}; };
Blockly.Blocks["array_getIndex"] = {
Blockly.Blocks['array_getIndex'] = {
/** /**
* Elapsed time in milliseconds block definition * Elapsed time in milliseconds block definition
* @this Blockly.Block * @this Blockly.Block
*/ */
init: function () { init: function () {
this.setHelpUrl('http://arduino.cc/en/Reference/Millis'); this.setHelpUrl("http://arduino.cc/en/Reference/Millis");
this.setColour(getColour().arrays); this.setColour(getColour().arrays);
this.appendDummyInput() this.appendDummyInput().appendField(
.appendField(new Blockly.FieldVariable( new Blockly.FieldVariable("X", null, ["Array"], "Array"),
'X', "FIELDNAME"
null, );
['Array'], this.setOutput(true, Types.ARRAY.typeName);
'Array'
), 'FIELDNAME');
this.setOutput(true, Types.ARRAY.typeId);
this.setTooltip(Blockly.Msg.ARD_TIME_MILLIS_TIP); this.setTooltip(Blockly.Msg.ARD_TIME_MILLIS_TIP);
}, },
}; };
Blockly.Blocks['lists_length'] = { Blockly.Blocks["lists_length"] = {
/** /**
* Elapsed time in milliseconds block definition * Elapsed time in milliseconds block definition
* @this Blockly.Block * @this Blockly.Block
*/ */
init: function () { init: function () {
this.setHelpUrl('http://arduino.cc/en/Reference/Millis'); this.setHelpUrl("http://arduino.cc/en/Reference/Millis");
this.setColour(getColour().arrays); this.setColour(getColour().arrays);
this.appendValueInput('ARRAY') this.appendValueInput("ARRAY")
.appendField('length of') .appendField("length of")
.setCheck(Types.ARRAY.compatibleTypes); .setCheck(Types.ARRAY.compatibleTypes);
this.setOutput(true, Types.NUMBER.typeName); this.setOutput(true, Types.NUMBER.typeName);
this.setTooltip(Blockly.Msg.ARD_TIME_MILLIS_TIP); this.setTooltip(Blockly.Msg.ARD_TIME_MILLIS_TIP);

View File

@ -11,32 +11,31 @@
* TODO: This block can be improved to set the new range properly. * TODO: This block can be improved to set the new range properly.
*/ */
import * as Blockly from "blockly/core";
import { getColour } from "../helpers/colour";
import * as Types from "../helpers/types";
import * as Blockly from 'blockly/core'; Blockly.Blocks["base_map"] = {
import { getColour } from '../helpers/colour';
import * as Types from '../helpers/types'
Blockly.Blocks['base_map'] = {
/** /**
* Block for creating a the map function. * Block for creating a the map function.
* @this Blockly.Block * @this Blockly.Block
*/ */
init: function () { init: function () {
this.setHelpUrl('http://arduino.cc/en/Reference/map'); this.setHelpUrl("http://arduino.cc/en/Reference/map");
this.setColour(getColour().math); this.setColour(getColour().math);
this.appendValueInput('NUM') this.appendValueInput("NUM")
.appendField(Blockly.Msg.ARD_MAP) .appendField(Blockly.Msg.ARD_MAP)
.setCheck(Types.NUMBER.compatibleTypes); .setCheck(Types.NUMBER.compatibleTypes);
this.appendValueInput('FMIN') this.appendValueInput("FMIN")
.appendField(Blockly.Msg.ARD_MAP_FROMMIN) .appendField(Blockly.Msg.ARD_MAP_FROMMIN)
.setCheck(Types.NUMBER.compatibleTypes); .setCheck(Types.NUMBER.compatibleTypes);
this.appendValueInput('FMAX') this.appendValueInput("FMAX")
.appendField(Blockly.Msg.ARD_MAP_FROMMAX) .appendField(Blockly.Msg.ARD_MAP_FROMMAX)
.setCheck(Types.NUMBER.compatibleTypes); .setCheck(Types.NUMBER.compatibleTypes);
this.appendValueInput('DMIN') this.appendValueInput("DMIN")
.appendField(Blockly.Msg.ARD_MAP_TOMIN) .appendField(Blockly.Msg.ARD_MAP_TOMIN)
.setCheck(Types.NUMBER.compatibleTypes); .setCheck(Types.NUMBER.compatibleTypes);
this.appendValueInput('DMAX') this.appendValueInput("DMAX")
.appendField(Blockly.Msg.ARD_MAP_TOMAX) .appendField(Blockly.Msg.ARD_MAP_TOMAX)
.setCheck(Types.NUMBER.compatibleTypes); .setCheck(Types.NUMBER.compatibleTypes);
this.setOutput(true); this.setOutput(true);
@ -45,6 +44,6 @@ Blockly.Blocks['base_map'] = {
}, },
/** @return {string} The type of return value for the block, an integer. */ /** @return {string} The type of return value for the block, an integer. */
getBlockType: function () { getBlockType: function () {
return Types.NUMBER.typeId; return Types.NUMBER.typeName;
} },
}; };

View File

@ -65,8 +65,8 @@ Blockly.Blocks["sensebox_phyphox_graph"] = {
.appendField(Blockly.Msg.sensebox_phyphox_graphStyle) .appendField(Blockly.Msg.sensebox_phyphox_graphStyle)
.appendField( .appendField(
new Blockly.FieldDropdown([ new Blockly.FieldDropdown([
[Blockly.Msg.sensebox_phyphox_style_dots, "dots"],
[Blockly.Msg.sensebox_phyphox_style_line, "line"], [Blockly.Msg.sensebox_phyphox_style_line, "line"],
[Blockly.Msg.sensebox_phyphox_style_dots, "dots"],
]), ]),
"style" "style"
); );

View File

@ -62,7 +62,7 @@ Blockly.Blocks["sensebox_rtc_get"] = {
]), ]),
"dropdown" "dropdown"
); );
this.setOutput(true, Types.LARGE_NUMBER.typeId); this.setOutput(true, Types.LARGE_NUMBER.typeName);
this.setTooltip(Blockly.Msg.sensebox_rtc_get_tooltip); this.setTooltip(Blockly.Msg.sensebox_rtc_get_tooltip);
}, },
}; };

View File

@ -330,7 +330,6 @@ Blockly.Blocks["sensebox_button"] = {
new Blockly.FieldDropdown([ new Blockly.FieldDropdown([
[Blockly.Msg.senseBox_button_isPressed, "isPressed"], [Blockly.Msg.senseBox_button_isPressed, "isPressed"],
[Blockly.Msg.senseBox_button_wasPressed, "wasPressed"], [Blockly.Msg.senseBox_button_wasPressed, "wasPressed"],
[Blockly.Msg.senseBox_button_switch, "Switch"],
[Blockly.Msg.senseBox_button_longPress, "longPress"], [Blockly.Msg.senseBox_button_longPress, "longPress"],
]), ]),
"FUNCTION" "FUNCTION"

View File

@ -59,7 +59,7 @@ Blockly.Blocks["time_millis"] = {
this.setHelpUrl("http://arduino.cc/en/Reference/Millis"); this.setHelpUrl("http://arduino.cc/en/Reference/Millis");
this.setColour(getColour().time); this.setColour(getColour().time);
this.appendDummyInput().appendField(Blockly.Msg.ARD_TIME_MILLIS); this.appendDummyInput().appendField(Blockly.Msg.ARD_TIME_MILLIS);
this.setOutput(true, Types.LARGE_NUMBER.typeId); this.setOutput(true, Types.LARGE_NUMBER.typeName);
this.setTooltip(Blockly.Msg.ARD_TIME_MILLIS_TIP); this.setTooltip(Blockly.Msg.ARD_TIME_MILLIS_TIP);
}, },
/** @return {string} The type of return value for the block, an integer. */ /** @return {string} The type of return value for the block, an integer. */
@ -77,7 +77,7 @@ Blockly.Blocks["time_micros"] = {
this.setHelpUrl("http://arduino.cc/en/Reference/Micros"); this.setHelpUrl("http://arduino.cc/en/Reference/Micros");
this.setColour(getColour().time); this.setColour(getColour().time);
this.appendDummyInput().appendField(Blockly.Msg.ARD_TIME_MICROS); this.appendDummyInput().appendField(Blockly.Msg.ARD_TIME_MICROS);
this.setOutput(true, Types.LARGE_NUMBER.typeId); this.setOutput(true, Types.LARGE_NUMBER.typeName);
this.setTooltip(Blockly.Msg.ARD_TIME_MICROS_TIP); this.setTooltip(Blockly.Msg.ARD_TIME_MICROS_TIP);
}, },
/** /**

View File

@ -13,9 +13,9 @@ Blockly.Arduino.sensebox_mqtt_setup = function () {
service = this.getFieldValue("service"); service = this.getFieldValue("service");
Blockly.Arduino.libraries_["library_senseBoxIO"] = "#include <senseBoxIO.h>"; Blockly.Arduino.libraries_["library_senseBoxIO"] = "#include <senseBoxIO.h>";
Blockly.Arduino.libraries_["library_adafruitmqtt"] = Blockly.Arduino.libraries_["library_adafruitmqtt"] =
'#include "Adafruit_MQTT.h //http://librarymanager/All#Adafruit_MQTT_Library"'; '#include <Adafruit_MQTT.h> //http://librarymanager/All#Adafruit_MQTT_Library"';
Blockly.Arduino.libraries_["library_adafruitmqttclient"] = Blockly.Arduino.libraries_["library_adafruitmqttclient"] =
'#include "Adafruit_MQTT_Client.h"'; '#include <Adafruit_MQTT_Client.h>';
Blockly.Arduino.definitions_["mqtt_server"] = Blockly.Arduino.definitions_["mqtt_server"] =
'#define SERVER "' + server + '"'; '#define SERVER "' + server + '"';
Blockly.Arduino.definitions_["mqtt_port"] = Blockly.Arduino.definitions_["mqtt_port"] =

View File

@ -90,7 +90,9 @@ Blockly.Arduino.sensebox_phyphox_graph = function () {
code += `${label}.setUnitY("${unity}");\n`; code += `${label}.setUnitY("${unity}");\n`;
code += `${label}.setLabelX("${labelx}");\n`; code += `${label}.setLabelX("${labelx}");\n`;
code += `${label}.setLabelY("${labely}");\n`; code += `${label}.setLabelY("${labely}");\n`;
if (style === "dots"){
code += `${label}.setStyle("${style}");\n`; code += `${label}.setStyle("${style}");\n`;
}
code += `${label}.setChannel(${channelX}, ${channelY});\n`; code += `${label}.setChannel(${channelX}, ${channelY});\n`;
code += `firstView.addElement(${label});\n`; code += `firstView.addElement(${label});\n`;
return code; return code;

View File

@ -13,7 +13,7 @@ Blockly.Arduino.sensebox_display_beginDisplay = function () {
"define_display_size" "define_display_size"
] = `#define SCREEN_WIDTH 128\n#define SCREEN_HEIGHT 64`; ] = `#define SCREEN_WIDTH 128\n#define SCREEN_HEIGHT 64`;
Blockly.Arduino.definitions_["define_display"] = Blockly.Arduino.definitions_["define_display"] =
"#define OLED_RESET 4\nAdafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);"; "#define OLED_RESET -1\nAdafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);";
Blockly.Arduino.setupCode_["sensebox_display_begin"] = Blockly.Arduino.setupCode_["sensebox_display_begin"] =
"senseBoxIO.powerI2C(true);\ndelay(2000);\ndisplay.begin(SSD1306_SWITCHCAPVCC, 0x3D);\ndisplay.display();\ndelay(100);\ndisplay.clearDisplay();"; "senseBoxIO.powerI2C(true);\ndelay(2000);\ndisplay.begin(SSD1306_SWITCHCAPVCC, 0x3D);\ndisplay.display();\ndelay(100);\ndisplay.clearDisplay();";

View File

@ -3,6 +3,7 @@ import * as Blockly from 'blockly/core';
Blockly.Arduino.sensebox_led = function () { Blockly.Arduino.sensebox_led = function () {
var dropdown_pin = this.getFieldValue('PIN'); var dropdown_pin = this.getFieldValue('PIN');
var dropdown_stat = this.getFieldValue('STAT'); var dropdown_stat = this.getFieldValue('STAT');
Blockly.Arduino.libraries_["library_senseBoxIO"] = "#include <senseBoxIO.h>";
Blockly.Arduino.setupCode_['setup_led_' + dropdown_pin] = 'pinMode(' + dropdown_pin + ', OUTPUT);'; Blockly.Arduino.setupCode_['setup_led_' + dropdown_pin] = 'pinMode(' + dropdown_pin + ', OUTPUT);';
var code = 'digitalWrite(' + dropdown_pin + ',' + dropdown_stat + ');\n' var code = 'digitalWrite(' + dropdown_pin + ',' + dropdown_stat + ');\n'
return code; return code;
@ -11,6 +12,7 @@ Blockly.Arduino.sensebox_led = function () {
Blockly.Arduino.sensebox_rgb_led = function () { Blockly.Arduino.sensebox_rgb_led = function () {
var dropdown_pin = this.getFieldValue('PIN'); var dropdown_pin = this.getFieldValue('PIN');
var color = Blockly.Arduino.valueToCode(this, 'COLOR', Blockly.Arduino.ORDER_ATOMIC) || '0' var color = Blockly.Arduino.valueToCode(this, 'COLOR', Blockly.Arduino.ORDER_ATOMIC) || '0'
Blockly.Arduino.libraries_["library_senseBoxIO"] = "#include <senseBoxIO.h>";
Blockly.Arduino.libraries_['define_rgb_led' + dropdown_pin] = '#include <Adafruit_NeoPixel.h>\n Adafruit_NeoPixel rgb_led_' + dropdown_pin + ' = Adafruit_NeoPixel(1,' + dropdown_pin + ',NEO_RGB + NEO_KHZ800);\n'; Blockly.Arduino.libraries_['define_rgb_led' + dropdown_pin] = '#include <Adafruit_NeoPixel.h>\n Adafruit_NeoPixel rgb_led_' + dropdown_pin + ' = Adafruit_NeoPixel(1,' + dropdown_pin + ',NEO_RGB + NEO_KHZ800);\n';
Blockly.Arduino.setupCode_['setup_rgb_led' + dropdown_pin] = 'rgb_led_' + dropdown_pin + '.begin();'; Blockly.Arduino.setupCode_['setup_rgb_led' + dropdown_pin] = 'rgb_led_' + dropdown_pin + '.begin();';
var code = 'rgb_led_' + dropdown_pin + '.setPixelColor(0,rgb_led_' + dropdown_pin + '.Color(' + color + '));\n'; var code = 'rgb_led_' + dropdown_pin + '.setPixelColor(0,rgb_led_' + dropdown_pin + '.Color(' + color + '));\n';
@ -23,6 +25,7 @@ Blockly.Arduino.sensebox_ws2818_led_init = function () {
var dropdown_pin = this.getFieldValue('Port'); var dropdown_pin = this.getFieldValue('Port');
var numPixel = Blockly.Arduino.valueToCode(this, 'NUMBER', Blockly.Arduino.ORDER_ATOMIC) || '1'; var numPixel = Blockly.Arduino.valueToCode(this, 'NUMBER', Blockly.Arduino.ORDER_ATOMIC) || '1';
var brightness = Blockly.Arduino.valueToCode(this, 'BRIGHTNESS', Blockly.Arduino.ORDER_ATOMIC) || '50' var brightness = Blockly.Arduino.valueToCode(this, 'BRIGHTNESS', Blockly.Arduino.ORDER_ATOMIC) || '50'
Blockly.Arduino.libraries_["library_senseBoxIO"] = "#include <senseBoxIO.h>";
Blockly.Arduino.definitions_['define_rgb_led' + dropdown_pin] = `#include <Adafruit_NeoPixel.h>\n Adafruit_NeoPixel rgb_led_${dropdown_pin}= Adafruit_NeoPixel(${numPixel}, ${dropdown_pin},NEO_GRB + NEO_KHZ800);\n`; Blockly.Arduino.definitions_['define_rgb_led' + dropdown_pin] = `#include <Adafruit_NeoPixel.h>\n Adafruit_NeoPixel rgb_led_${dropdown_pin}= Adafruit_NeoPixel(${numPixel}, ${dropdown_pin},NEO_GRB + NEO_KHZ800);\n`;
Blockly.Arduino.setupCode_['setup_rgb_led' + dropdown_pin] = 'rgb_led_' + dropdown_pin + '.begin();\n'; Blockly.Arduino.setupCode_['setup_rgb_led' + dropdown_pin] = 'rgb_led_' + dropdown_pin + '.begin();\n';
Blockly.Arduino.setupCode_['setup_rgb_led_brightness' + dropdown_pin] = `rgb_led_${dropdown_pin}.setBrightness(${brightness});\n`; Blockly.Arduino.setupCode_['setup_rgb_led_brightness' + dropdown_pin] = `rgb_led_${dropdown_pin}.setBrightness(${brightness});\n`;
@ -30,6 +33,7 @@ Blockly.Arduino.sensebox_ws2818_led_init = function () {
}; };
Blockly.Arduino.sensebox_ws2818_led = function () { Blockly.Arduino.sensebox_ws2818_led = function () {
Blockly.Arduino.libraries_["library_senseBoxIO"] = "#include <senseBoxIO.h>";
var dropdown_pin = this.getFieldValue('Port'); var dropdown_pin = this.getFieldValue('Port');
var position = Blockly.Arduino.valueToCode(this, 'POSITION', Blockly.Arduino.ORDER_ATOMIC) || '0'; var position = Blockly.Arduino.valueToCode(this, 'POSITION', Blockly.Arduino.ORDER_ATOMIC) || '0';
var color = Blockly.Arduino.valueToCode(this, 'COLOR', Blockly.Arduino.ORDER_ATOMIC) || '0' var color = Blockly.Arduino.valueToCode(this, 'COLOR', Blockly.Arduino.ORDER_ATOMIC) || '0'
@ -48,6 +52,7 @@ function hexToRgb(hex) {
} }
Blockly.Arduino['colour_picker'] = function (block) { Blockly.Arduino['colour_picker'] = function (block) {
Blockly.Arduino.libraries_["library_senseBoxIO"] = "#include <senseBoxIO.h>";
const rgb = hexToRgb(block.getFieldValue('COLOUR')); const rgb = hexToRgb(block.getFieldValue('COLOUR'));
return [rgb.r + ', ' + rgb.g + ', ' + rgb.b, Blockly.Arduino.ORDER_ATOMIC]; return [rgb.r + ', ' + rgb.g + ', ' + rgb.b, Blockly.Arduino.ORDER_ATOMIC];
@ -58,6 +63,7 @@ Blockly.Arduino['colour_random'] = function (block) {
}; };
Blockly.Arduino['colour_rgb'] = function (block) { Blockly.Arduino['colour_rgb'] = function (block) {
Blockly.Arduino.libraries_["library_senseBoxIO"] = "#include <senseBoxIO.h>";
const red = Blockly.Arduino.valueToCode(block, 'RED', Blockly.Arduino.ORDER_ATOMIC); const red = Blockly.Arduino.valueToCode(block, 'RED', Blockly.Arduino.ORDER_ATOMIC);
const green = Blockly.Arduino.valueToCode(block, 'GREEN', Blockly.Arduino.ORDER_ATOMIC); const green = Blockly.Arduino.valueToCode(block, 'GREEN', Blockly.Arduino.ORDER_ATOMIC);
const blue = Blockly.Arduino.valueToCode(block, 'BLUE', Blockly.Arduino.ORDER_ATOMIC); const blue = Blockly.Arduino.valueToCode(block, 'BLUE', Blockly.Arduino.ORDER_ATOMIC);

View File

@ -160,11 +160,11 @@ Blockly.Arduino.sensebox_sensor_sds011 = function () {
Blockly.Arduino.definitions_["define_sds011"] = Blockly.Arduino.definitions_["define_sds011"] =
"SdsDustSensor sds(" + serial_name + ");"; "SdsDustSensor sds(" + serial_name + ");";
Blockly.Arduino.setupCode_["sds011_begin"] = "sds.begin();"; Blockly.Arduino.setupCode_["sds011_begin"] = "sds.begin();";
Blockly.Arduino.setupCode_["sds011_setActiveReporting"] = Blockly.Arduino.setupCode_["sds011_setQueryReportingMode"] =
"sds.setActiveReportingMode();"; "sds.setQueryReportingMode();";
Blockly.Arduino.loopCodeOnce_[ Blockly.Arduino.loopCodeOnce_[
"sds011_getData" "sds011_getData"
] = `PmResult pm = sds.readPm();`; ] = `PmResult pm = sds.queryPm();`;
var code = `pm.${dropdown_name}`; var code = `pm.${dropdown_name}`;
return [code, Blockly.Arduino.ORDER_ATOMIC]; return [code, Blockly.Arduino.ORDER_ATOMIC];
}; };
@ -183,7 +183,7 @@ Blockly.Arduino.sensebox_sensor_pressure = function () {
"adafruit_bmp280" "adafruit_bmp280"
] = `#include <Adafruit_BMP280.h> // http://librarymanager/All#Adafruit_BMP280_Library`; ] = `#include <Adafruit_BMP280.h> // http://librarymanager/All#Adafruit_BMP280_Library`;
Blockly.Arduino.definitions_["define_pressure"] = "Adafruit_BMP280 bmp;"; Blockly.Arduino.definitions_["define_pressure"] = "Adafruit_BMP280 bmp;";
Blockly.Arduino.setupCode_["sensebox_bmp_sensor"] = "bmp.begin();"; Blockly.Arduino.setupCode_["sensebox_bmp_sensor"] = "bmp.begin(0x76);";
Blockly.Arduino.setupCode_["bmp_setSampling"] = ` Blockly.Arduino.setupCode_["bmp_setSampling"] = `
bmp.setSampling(Adafruit_BMP280::MODE_NORMAL, bmp.setSampling(Adafruit_BMP280::MODE_NORMAL,
Adafruit_BMP280::SAMPLING_X2, Adafruit_BMP280::SAMPLING_X2,
@ -408,8 +408,6 @@ Blockly.Arduino.sensebox_button = function () {
var code = ""; var code = "";
if (dropown_function === "isPressed") { if (dropown_function === "isPressed") {
code = "button_" + dropdown_pin + ".isPressed()"; code = "button_" + dropdown_pin + ".isPressed()";
} else if (dropown_function === "Switch") {
code = "button_" + dropdown_pin + ".getSwitch()";
} else if (dropown_function === "wasPressed") { } else if (dropown_function === "wasPressed") {
code = "button_" + dropdown_pin + ".wasPressed()"; code = "button_" + dropdown_pin + ".wasPressed()";
} else if (dropown_function === "longPress") { } else if (dropown_function === "longPress") {

View File

@ -46,7 +46,7 @@ Blockly.Arduino.sensebox_wifi_rssi = function () {
Blockly.Arduino.sensebox_get_ip = function () { Blockly.Arduino.sensebox_get_ip = function () {
Blockly.Arduino.definitions_["define_ipadress"] = "IPAddress ip;"; Blockly.Arduino.definitions_["define_ipadress"] = "IPAddress ip;";
Blockly.Arduino.setupCode_["sensebox_get_ip"] = " ip = WiFi.localIP();"; Blockly.Arduino.setupCode_["sensebox_get_ip"] = " ip = WiFi.localIP();";
var code = ""; var code = "ip";
return [code, Blockly.Arduino.ORDER_ATOMIC]; return [code, Blockly.Arduino.ORDER_ATOMIC];
}; };

View File

@ -1,23 +1,26 @@
export const IO = { export const IO = {
ARD_ANALOGREAD: "lese analogen Pin#", ARD_ANALOGREAD: "lese analogen Pin#",
ARD_ANALOGREAD_TIP: "Gibt einen Wert zwischen 0 und 1024 zurüch", ARD_ANALOGREAD_TIP: "Gibt einen Wert zwischen 0 und 1023 zurück",
ARD_ANALOGWRITE: "setzte analogen Pin#", ARD_ANALOGWRITE: "setzte analogen Pin#",
ARD_ANALOGWRITE_TIP: "Schreibe analogen Wert zwischen 0 und 255 an einen spezifischen PWM Port", ARD_ANALOGWRITE_TIP:
"Schreibe analogen Wert zwischen 0 und 255 an einen spezifischen PWM Port",
ARD_BUILTIN_LED: "eingebaute LED", ARD_BUILTIN_LED: "eingebaute LED",
ARD_BUILTIN_LED_TIP: "Schaltet die interne LED An oder Aus", ARD_BUILTIN_LED_TIP: "Schaltet die interne LED An oder Aus",
ARD_COMPONENT_WARN1: "A %1 configuration block with the same %2 name must be added to use this block!", ARD_COMPONENT_WARN1:
"A %1 configuration block with the same %2 name must be added to use this block!",
ARD_DEFINE: "Definiere", ARD_DEFINE: "Definiere",
ARD_DIGITALREAD: "lesen digitalen Pin#", ARD_DIGITALREAD: "lesen digitalen Pin#",
ARD_DIGITALREAD_TIP: "Lese Wert an digitalen Pin: HIGH(1) oder LOW(0)", ARD_DIGITALREAD_TIP: "Lese Wert an digitalen Pin: HIGH(1) oder LOW(0)",
ARD_DIGITALWRITE: "setzte digitalen Pin#", ARD_DIGITALWRITE: "setzte digitalen Pin#",
ARD_DIGITALWRITE_TIP: "Schreibe digitalen Wert HIGH (1) oder LOW(0) an spezifischen Port", ARD_DIGITALWRITE_TIP:
"Schreibe digitalen Wert HIGH (1) oder LOW(0) an spezifischen Port",
ARD_FUN_RUN_LOOP: "Endlosschleife()", ARD_FUN_RUN_LOOP: "Endlosschleife()",
ARD_FUN_RUN_SETUP: "Setup()", ARD_FUN_RUN_SETUP: "Setup()",
ARD_FUN_RUN_TIP: "Definiert die setup() und loop() Funktionen. Die setup()-Funktion wird beim starten **einmal** ausgeführt. Anschließend wir die loop()-Funktion in einer **Endlosschleife** ausgeführt. Füge in die Setup()-Funktion Blöcke ein, um z.B. das Display zu initalisieren, eine Verbindung zum WiFi-Netzwerk herzustellen oder um die LoRa Verbindung zu initialsieren.", ARD_FUN_RUN_TIP:
"Definiert die setup() und loop() Funktionen. Die setup()-Funktion wird beim starten **einmal** ausgeführt. Anschließend wir die loop()-Funktion in einer **Endlosschleife** ausgeführt. Füge in die Setup()-Funktion Blöcke ein, um z.B. das Display zu initalisieren, eine Verbindung zum WiFi-Netzwerk herzustellen oder um die LoRa Verbindung zu initialsieren.",
ARD_HIGH: "HIGH", ARD_HIGH: "HIGH",
ARD_HIGHLOW_TIP: "Setzt einen Status auf HIGH oder LOWSet a pin state logic High or Low.", ARD_HIGHLOW_TIP:
"Setzt einen Status auf HIGH oder LOWSet a pin state logic High or Low.",
ARD_LOW: "LOW", ARD_LOW: "LOW",
ARD_MAP: "Verteile Wert", ARD_MAP: "Verteile Wert",
ARD_MAP_FROMMIN: "von Minimum", ARD_MAP_FROMMIN: "von Minimum",
@ -30,16 +33,21 @@ export const IO = {
ARD_NOTONE_PIN: "keinen Ton an Pin", ARD_NOTONE_PIN: "keinen Ton an Pin",
ARD_NOTONE_PIN_TIP: "Stoppe die Tonerzeugung an Pin", ARD_NOTONE_PIN_TIP: "Stoppe die Tonerzeugung an Pin",
ARD_NOTONE_TIP: "Schaltet den Ton am ausgewählten Pin aus", ARD_NOTONE_TIP: "Schaltet den Ton am ausgewählten Pin aus",
ARD_PIN_WARN1: "Pin %1 wird benötigt für %2 als Pin %3. Bereitsgenutzt als %4.", ARD_PIN_WARN1:
ARD_PULSETIMEOUT_TIP: "Misst die Laufzeit eines Impulses am ausgewählten Pin, wenn die Zeit ist in Microsekunden.", "Pin %1 wird benötigt für %2 als Pin %3. Bereitsgenutzt als %4.",
ARD_PULSETIMEOUT_TIP:
"Misst die Laufzeit eines Impulses am ausgewählten Pin, wenn die Zeit ist in Microsekunden.",
ARD_PULSE_READ: "Misst %1 Impuls an Pin #%2", ARD_PULSE_READ: "Misst %1 Impuls an Pin #%2",
ARD_PULSE_READ_TIMEOUT: "Misst %1 Impuls an Pin #%2 (Unterbrechung nach %3 μs)", ARD_PULSE_READ_TIMEOUT:
"Misst %1 Impuls an Pin #%2 (Unterbrechung nach %3 μs)",
ARD_PULSE_TIP: "Misst die Zeit eines Impulses an dem ausgewählten Pin.", ARD_PULSE_TIP: "Misst die Zeit eines Impulses an dem ausgewählten Pin.",
ARD_SERIAL_BPS: "bps", ARD_SERIAL_BPS: "bps",
ARD_SERIAL_PRINT: "schreibe", ARD_SERIAL_PRINT: "schreibe",
ARD_SERIAL_PRINT_NEWLINE: "neue Zeile hinzufügen", ARD_SERIAL_PRINT_NEWLINE: "neue Zeile hinzufügen",
ARD_SERIAL_PRINT_TIP: "Prints data to the console/serial port as human-readable ASCII text.", // untranslated ARD_SERIAL_PRINT_TIP:
ARD_SERIAL_PRINT_WARN: "A setup block for %1 must be added to the workspace to use this block!", // untranslated "Prints data to the console/serial port as human-readable ASCII text.", // untranslated
ARD_SERIAL_PRINT_WARN:
"A setup block for %1 must be added to the workspace to use this block!", // untranslated
ARD_SERIAL_SETUP: "Setup", ARD_SERIAL_SETUP: "Setup",
ARD_SERIAL_SETUP_TIP: "Selects the speed for a specific Serial peripheral", // untranslated ARD_SERIAL_SETUP_TIP: "Selects the speed for a specific Serial peripheral", // untranslated
ARD_SERIAL_SPEED: ": Übertragungsgeschwindigkeit zu", ARD_SERIAL_SPEED: ": Übertragungsgeschwindigkeit zu",
@ -62,12 +70,14 @@ export const IO = {
ARD_SPI_SETUP_MSBFIRST: "MSBFIRST", // untranslated ARD_SPI_SETUP_MSBFIRST: "MSBFIRST", // untranslated
ARD_SPI_SETUP_SHIFT: "data shift", // untranslated ARD_SPI_SETUP_SHIFT: "data shift", // untranslated
ARD_SPI_SETUP_TIP: "Configures the SPI peripheral.", // untranslated ARD_SPI_SETUP_TIP: "Configures the SPI peripheral.", // untranslated
ARD_SPI_TRANSRETURN_TIP: "Send a SPI message to an specified slave device and get data back.", // untranslated ARD_SPI_TRANSRETURN_TIP:
"Send a SPI message to an specified slave device and get data back.", // untranslated
ARD_SPI_TRANS_NONE: "none", // untranslated ARD_SPI_TRANS_NONE: "none", // untranslated
ARD_SPI_TRANS_SLAVE: "to slave pin", // untranslated ARD_SPI_TRANS_SLAVE: "to slave pin", // untranslated
ARD_SPI_TRANS_TIP: "Send a SPI message to an specified slave device.", // untranslated ARD_SPI_TRANS_TIP: "Send a SPI message to an specified slave device.", // untranslated
ARD_SPI_TRANS_VAL: "transfer", // untranslated ARD_SPI_TRANS_VAL: "transfer", // untranslated
ARD_SPI_TRANS_WARN1: "A setup block for %1 must be added to the workspace to use this block!", // untranslated ARD_SPI_TRANS_WARN1:
"A setup block for %1 must be added to the workspace to use this block!", // untranslated
ARD_SPI_TRANS_WARN2: "Old pin value %1 is no longer available.", // untranslated ARD_SPI_TRANS_WARN2: "Old pin value %1 is no longer available.", // untranslated
ARD_STEPPER_COMPONENT: "stepper", // untranslated ARD_STEPPER_COMPONENT: "stepper", // untranslated
ARD_STEPPER_DEFAULT_NAME: "MyStepper", // untranslated ARD_STEPPER_DEFAULT_NAME: "MyStepper", // untranslated
@ -80,7 +90,8 @@ export const IO = {
ARD_STEPPER_PIN4: "pin4#", // untranslated ARD_STEPPER_PIN4: "pin4#", // untranslated
ARD_STEPPER_REVOLVS: "how many steps per revolution", // untranslated ARD_STEPPER_REVOLVS: "how many steps per revolution", // untranslated
ARD_STEPPER_SETUP: "Setup stepper motor", // untranslated ARD_STEPPER_SETUP: "Setup stepper motor", // untranslated
ARD_STEPPER_SETUP_TIP: "Configures a stepper motor pinout and other settings.", // untranslated ARD_STEPPER_SETUP_TIP:
"Configures a stepper motor pinout and other settings.", // untranslated
ARD_STEPPER_SPEED: "set speed (rpm) to", // untranslated ARD_STEPPER_SPEED: "set speed (rpm) to", // untranslated
ARD_STEPPER_STEP: "move stepper", // untranslated ARD_STEPPER_STEP: "move stepper", // untranslated
ARD_STEPPER_STEPS: "steps", // untranslated ARD_STEPPER_STEPS: "steps", // untranslated
@ -104,5 +115,4 @@ export const IO = {
NEW_INSTANCE_TITLE: "Neue Instanz mit Name:", NEW_INSTANCE_TITLE: "Neue Instanz mit Name:",
RENAME_INSTANCE: "Instanz umbenennen...", RENAME_INSTANCE: "Instanz umbenennen...",
RENAME_INSTANCE_TITLE: "Benenne alle '%1' Instanzen zu:", RENAME_INSTANCE_TITLE: "Benenne alle '%1' Instanzen zu:",
};
}

View File

@ -85,9 +85,9 @@ export const UI = {
messages_rename_success_01: "Das Projekt wurde erfolgreich in ", messages_rename_success_01: "Das Projekt wurde erfolgreich in ",
messages_rename_success_02: "umbenannt.", messages_rename_success_02: "umbenannt.",
messages_newblockly_head: messages_newblockly_head:
"Willkommen zur neuen Version Blockly für die senseBox", "Willkommen zur neuen senseBox Lern- und Programmierumgebung",
messages_newblockly_text: messages_newblockly_text:
"Die neue Blockly-Version befindet sich derzeit in der Testphase. Wenn Sie einen Fehler finden, melden Sie diesen bitte in unserem [Forum](https://forum.sensebox.de/t/neue-blockly-version-beta-test-und-feedback/1176). Eine Übersicht über alle neuen Funktionen finden Sie [hier](/news)", "Nach einer Testphase kann die neue senseBox Lern- und Programmierumgebung verwendet werden. Wenn Sie weiterhin Fehler finden, melden Sie diesen bitte in unserem [Forum](https://forum.sensebox.de/t/neue-blockly-version-beta-test-und-feedback/1176). Eine Übersicht über alle neuen Funktionen finden Sie [hier](/news)",
messages_GET_TUTORIAL_FAIL: "Zurück zur Tutorials-Übersicht", messages_GET_TUTORIAL_FAIL: "Zurück zur Tutorials-Übersicht",
messages_LOGIN_FAIL: "Der Benutzername oder das Passwort ist nicht korrekt.", messages_LOGIN_FAIL: "Der Benutzername oder das Passwort ist nicht korrekt.",
messages_copy_code: "Code wurde in die Zwischenablage kopiert", messages_copy_code: "Code wurde in die Zwischenablage kopiert",

View File

@ -1,13 +1,13 @@
export const IO = { export const IO = {
ARD_ANALOGREAD: "read analog pin#", ARD_ANALOGREAD: "read analog pin#",
ARD_ANALOGREAD_TIP: "Return value between 0 and 1024", ARD_ANALOGREAD_TIP: "Return value between 0 and 1023",
ARD_ANALOGWRITE: "set analog pin#", ARD_ANALOGWRITE: "set analog pin#",
ARD_ANALOGWRITE_TIP: "Write analog value between 0 and 255 to a specific PWM Port", ARD_ANALOGWRITE_TIP:
"Write analog value between 0 and 255 to a specific PWM Port",
ARD_BUILTIN_LED: "set built-in LED", ARD_BUILTIN_LED: "set built-in LED",
ARD_BUILTIN_LED_TIP: "Light on or off for the built-in LED of the Arduino", ARD_BUILTIN_LED_TIP: "Light on or off for the built-in LED of the Arduino",
ARD_COMPONENT_WARN1: "A %1 configuration block with the same %2 name must be added to use this block!", ARD_COMPONENT_WARN1:
"A %1 configuration block with the same %2 name must be added to use this block!",
ARD_DEFINE: "Define", ARD_DEFINE: "Define",
ARD_DIGITALREAD: "read digital pin#", ARD_DIGITALREAD: "read digital pin#",
ARD_DIGITALREAD_TIP: "Read digital value on a pin: HIGH or LOW", ARD_DIGITALREAD_TIP: "Read digital value on a pin: HIGH or LOW",
@ -31,15 +31,18 @@ export const IO = {
ARD_NOTONE_PIN_TIP: "Stop generating a tone on a pin", ARD_NOTONE_PIN_TIP: "Stop generating a tone on a pin",
ARD_NOTONE_TIP: "Turns the tone off on the selected pin", ARD_NOTONE_TIP: "Turns the tone off on the selected pin",
ARD_PIN_WARN1: "Pin %1 is needed for %2 as pin %3. Already used as %4.", ARD_PIN_WARN1: "Pin %1 is needed for %2 as pin %3. Already used as %4.",
ARD_PULSETIMEOUT_TIP: "Measures the duration of a pulse on the selected pin, if it is within the time-out in microseconds.", ARD_PULSETIMEOUT_TIP:
"Measures the duration of a pulse on the selected pin, if it is within the time-out in microseconds.",
ARD_PULSE_READ: "measure %1 pulse on pin #%2", ARD_PULSE_READ: "measure %1 pulse on pin #%2",
ARD_PULSE_READ_TIMEOUT: "measure %1 pulse on pin #%2 (timeout after %3 μs)", ARD_PULSE_READ_TIMEOUT: "measure %1 pulse on pin #%2 (timeout after %3 μs)",
ARD_PULSE_TIP: "Measures the duration of a pulse on the selected pin.", ARD_PULSE_TIP: "Measures the duration of a pulse on the selected pin.",
ARD_SERIAL_BPS: "bps", ARD_SERIAL_BPS: "bps",
ARD_SERIAL_PRINT: "print", ARD_SERIAL_PRINT: "print",
ARD_SERIAL_PRINT_NEWLINE: "add new line", ARD_SERIAL_PRINT_NEWLINE: "add new line",
ARD_SERIAL_PRINT_TIP: "Prints data to the console/serial port as human-readable ASCII text.", ARD_SERIAL_PRINT_TIP:
ARD_SERIAL_PRINT_WARN: "A setup block for %1 must be added to the workspace to use this block!", "Prints data to the console/serial port as human-readable ASCII text.",
ARD_SERIAL_PRINT_WARN:
"A setup block for %1 must be added to the workspace to use this block!",
ARD_SERIAL_SETUP: "Setup", ARD_SERIAL_SETUP: "Setup",
ARD_SERIAL_SETUP_TIP: "Selects the speed for a specific Serial peripheral", ARD_SERIAL_SETUP_TIP: "Selects the speed for a specific Serial peripheral",
ARD_SERIAL_SPEED: ": speed to", ARD_SERIAL_SPEED: ": speed to",
@ -62,12 +65,14 @@ export const IO = {
ARD_SPI_SETUP_MSBFIRST: "MSBFIRST", ARD_SPI_SETUP_MSBFIRST: "MSBFIRST",
ARD_SPI_SETUP_SHIFT: "data shift", ARD_SPI_SETUP_SHIFT: "data shift",
ARD_SPI_SETUP_TIP: "Configures the SPI peripheral.", ARD_SPI_SETUP_TIP: "Configures the SPI peripheral.",
ARD_SPI_TRANSRETURN_TIP: "Send a SPI message to an specified slave device and get data back.", ARD_SPI_TRANSRETURN_TIP:
"Send a SPI message to an specified slave device and get data back.",
ARD_SPI_TRANS_NONE: "none", ARD_SPI_TRANS_NONE: "none",
ARD_SPI_TRANS_SLAVE: "to slave pin", ARD_SPI_TRANS_SLAVE: "to slave pin",
ARD_SPI_TRANS_TIP: "Send a SPI message to an specified slave device.", ARD_SPI_TRANS_TIP: "Send a SPI message to an specified slave device.",
ARD_SPI_TRANS_VAL: "transfer", ARD_SPI_TRANS_VAL: "transfer",
ARD_SPI_TRANS_WARN1: "A setup block for %1 must be added to the workspace to use this block!", ARD_SPI_TRANS_WARN1:
"A setup block for %1 must be added to the workspace to use this block!",
ARD_SPI_TRANS_WARN2: "Old pin value %1 is no longer available.", ARD_SPI_TRANS_WARN2: "Old pin value %1 is no longer available.",
ARD_STEPPER_COMPONENT: "stepper", ARD_STEPPER_COMPONENT: "stepper",
ARD_STEPPER_DEFAULT_NAME: "MyStepper", ARD_STEPPER_DEFAULT_NAME: "MyStepper",
@ -80,7 +85,8 @@ export const IO = {
ARD_STEPPER_PIN4: "pin4#", ARD_STEPPER_PIN4: "pin4#",
ARD_STEPPER_REVOLVS: "how many steps per revolution", ARD_STEPPER_REVOLVS: "how many steps per revolution",
ARD_STEPPER_SETUP: "Setup stepper motor", ARD_STEPPER_SETUP: "Setup stepper motor",
ARD_STEPPER_SETUP_TIP: "Configures a stepper motor pinout and other settings.", ARD_STEPPER_SETUP_TIP:
"Configures a stepper motor pinout and other settings.",
ARD_STEPPER_SPEED: "set speed (rpm) to", ARD_STEPPER_SPEED: "set speed (rpm) to",
ARD_STEPPER_STEP: "move stepper", ARD_STEPPER_STEP: "move stepper",
ARD_STEPPER_STEPS: "steps", ARD_STEPPER_STEPS: "steps",
@ -104,4 +110,4 @@ export const IO = {
NEW_INSTANCE_TITLE: "New instance name:", NEW_INSTANCE_TITLE: "New instance name:",
RENAME_INSTANCE: "Rename instance...", RENAME_INSTANCE: "Rename instance...",
RENAME_INSTANCE_TITLE: "Rename all '%1' instances to:", RENAME_INSTANCE_TITLE: "Rename all '%1' instances to:",
} };

View File

@ -544,7 +544,7 @@ Blockly.Msg.PROCEDURES_DEFRETURN_COMMENT =
// Ardublockly strings // Ardublockly strings
Blockly.Msg.ARD_ANALOGREAD = "read analog pin#"; Blockly.Msg.ARD_ANALOGREAD = "read analog pin#";
Blockly.Msg.ARD_ANALOGREAD_TIP = "Return value between 0 and 1024"; Blockly.Msg.ARD_ANALOGREAD_TIP = "Return value between 0 and 1023";
Blockly.Msg.ARD_ANALOGWRITE = "set analog pin#"; Blockly.Msg.ARD_ANALOGWRITE = "set analog pin#";
Blockly.Msg.ARD_ANALOGWRITE_TIP = Blockly.Msg.ARD_ANALOGWRITE_TIP =
"Write analog value between 0 and 255 to a specific PWM Port"; "Write analog value between 0 and 255 to a specific PWM Port";