Hi Erik,
I went throght creating custom blocks and i created my custom block and i can't see my custom block in toolbox PFA.
I have below code in js file:
Blockly.Blocks['set_led'] = {
init: function() {
this.appendDummyInput()
.appendField("set led")
.appendField(new Blockly.FieldDropdown([["true","true"], ["false","false"]]), "SET_LED");
this.setPreviousStatement(true, null);
this.setNextStatement(true, null);
this.setColour(230);
this.setTooltip("");
this.setHelpUrl("");
}
};
Blockly.JavaScript['set_led'] = function(block) {
var dropdown_set_led = block.getFieldValue('SET_LED');
console.log(dropdown_set_led);
// TODO: Assemble JavaScript into code variable.
var code = '...;\n';
return code;
};
also added file path in script tag in html.
Please help me, i am doing right?
or anything i have to wrote more for that.