add block type to setter and getter

This commit is contained in:
Mario
2020-09-29 10:30:35 +02:00
parent da4c8840ea
commit 5304907fd0
7 changed files with 237 additions and 341 deletions
@@ -15,7 +15,7 @@ const setVariableFunction = function (defaultValue) {
const allVars = Blockly.getMainWorkspace().getVariableMap().getAllVariables();
const myVar = allVars.filter(v => v.name === variableName)[0]
Blockly.Arduino.setupCode_[''] = myVar.type + " " + myVar.name + ';\n';
Blockly.Arduino.variables_[myVar] = myVar.type + " " + myVar.name + ';\n';
return variableName + ' = ' + (variableValue || defaultValue) + ';\n';
};
};