Fix issue where some blocks would not connect correctly.

 Old version of Blockly did not use strings as data denominators, so this was updated in the Arduino generators.
parent 4393cd12
......@@ -32,12 +32,12 @@ Blockly.Blocks['base_map'] = {
helpUrl: 'http://arduino.cc/en/Reference/map',
init: function() {
this.setColour(230);
this.appendValueInput("NUM", Number)
this.appendValueInput("NUM", 'Number')
.appendTitle("Map ")
.setCheck(Number);
this.appendValueInput("DMAX", Number)
.setCheck('Number');
this.appendValueInput("DMAX", 'Number')
.appendTitle("value to [0-")
.setCheck(Number);
.setCheck('Number');
this.appendDummyInput("")
.appendTitle("]");
this.setInputsInline(true);
......@@ -60,7 +60,7 @@ Blockly.Blocks['serial_print'] = {
helpUrl: 'http://www.arduino.cc/en/Serial/Print',
init: function() {
this.setColour(230);
this.appendValueInput("CONTENT", String)
this.appendValueInput("CONTENT", 'String')
.appendTitle("Serial Print");
this.setPreviousStatement(true, null);
this.setNextStatement(true, null);
......
......@@ -41,7 +41,7 @@ Blockly.Blocks['io_digitalread'] = {
this.appendDummyInput("")
.appendField("DigitalRead PIN#")
.appendField(new Blockly.FieldDropdown(profile.default.digital), "PIN");
this.setOutput(true, Boolean);
this.setOutput(true, 'Boolean');
this.setTooltip('');
}
};
......@@ -87,9 +87,9 @@ Blockly.Blocks['io_analogwrite'] = {
this.appendDummyInput("")
.appendField("AnalogWrite PIN#")
.appendField(new Blockly.FieldDropdown(profile.default.analog), "PIN");
this.appendValueInput("NUM", Number)
this.appendValueInput("NUM", 'Number')
.appendField("value")
.setCheck(Number);
.setCheck('Number');
this.setInputsInline(true);
this.setPreviousStatement(true, null);
this.setNextStatement(true, null);
......@@ -116,7 +116,7 @@ Blockly.Blocks['io_analogread'] = {
this.appendDummyInput("")
.appendField("AnalogRead PIN#")
.appendField(new Blockly.FieldDropdown(profile.default.analog), "PIN");
this.setOutput(true, Number);
this.setOutput(true, 'Number');
this.setTooltip('Return value between 0 and 1024');
}
};
......@@ -137,7 +137,7 @@ Blockly.Blocks['io_highlow'] = {
this.setColour(230);
this.appendDummyInput("")
.appendField(new Blockly.FieldDropdown([["HIGH", "HIGH"], ["LOW", "LOW"]]), 'BOOL')
this.setOutput(true, Boolean);
this.setOutput(true, 'Boolean');
this.setTooltip("Set a pin state logic High or Low");
}
};
......
......@@ -12,9 +12,9 @@ Blockly.Blocks['time_delay'] = {
helpUrl: 'http://arduino.cc/en/Reference/Delay',
init: function() {
this.setColour(120);
this.appendValueInput("DELAY_TIME", Number)
this.appendValueInput("DELAY_TIME", 'Number')
.appendField("Delay")
.setCheck(Number)
.setCheck('Number')
.appendField("Milliseconds");
this.setInputsInline(true);
this.setPreviousStatement(true, null);
......@@ -40,9 +40,9 @@ Blockly.Blocks['time_delaymicros'] = {
helpUrl: 'http://arduino.cc/en/Reference/DelayMicroseconds',
init: function() {
this.setColour(120);
this.appendValueInput("DELAY_TIME_MS", Number)
this.appendValueInput("DELAY_TIME_MS", 'Number')
.appendField("Delay")
.setCheck(Number)
.setCheck('Number')
.appendField("Microseconds");
this.setInputsInline(true);
this.setPreviousStatement(true, null);
......@@ -69,7 +69,7 @@ Blockly.Blocks['time_millis'] = {
this.setColour(120);
this.appendDummyInput("")
.appendField("Elapsed Time (Milli)");
this.setOutput(true, Number);
this.setOutput(true, 'Number');
this.setTooltip('Returns the number of milliseconds since the Arduino board began running the current program.');
}
};
......@@ -92,7 +92,7 @@ Blockly.Blocks['time_micros'] = {
this.setColour(120);
this.appendDummyInput("")
.appendField("Elapsed Time (Micro)");
this.setOutput(true, Number);
this.setOutput(true, 'Number');
this.setTooltip('Returns the number of microseconds since the Arduino board began running the current program.');
}
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment