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'] = { ...@@ -32,12 +32,12 @@ Blockly.Blocks['base_map'] = {
helpUrl: 'http://arduino.cc/en/Reference/map', helpUrl: 'http://arduino.cc/en/Reference/map',
init: function() { init: function() {
this.setColour(230); this.setColour(230);
this.appendValueInput("NUM", Number) this.appendValueInput("NUM", 'Number')
.appendTitle("Map ") .appendTitle("Map ")
.setCheck(Number); .setCheck('Number');
this.appendValueInput("DMAX", Number) this.appendValueInput("DMAX", 'Number')
.appendTitle("value to [0-") .appendTitle("value to [0-")
.setCheck(Number); .setCheck('Number');
this.appendDummyInput("") this.appendDummyInput("")
.appendTitle("]"); .appendTitle("]");
this.setInputsInline(true); this.setInputsInline(true);
...@@ -60,7 +60,7 @@ Blockly.Blocks['serial_print'] = { ...@@ -60,7 +60,7 @@ Blockly.Blocks['serial_print'] = {
helpUrl: 'http://www.arduino.cc/en/Serial/Print', helpUrl: 'http://www.arduino.cc/en/Serial/Print',
init: function() { init: function() {
this.setColour(230); this.setColour(230);
this.appendValueInput("CONTENT", String) this.appendValueInput("CONTENT", 'String')
.appendTitle("Serial Print"); .appendTitle("Serial Print");
this.setPreviousStatement(true, null); this.setPreviousStatement(true, null);
this.setNextStatement(true, null); this.setNextStatement(true, null);
......
...@@ -41,7 +41,7 @@ Blockly.Blocks['io_digitalread'] = { ...@@ -41,7 +41,7 @@ Blockly.Blocks['io_digitalread'] = {
this.appendDummyInput("") this.appendDummyInput("")
.appendField("DigitalRead PIN#") .appendField("DigitalRead PIN#")
.appendField(new Blockly.FieldDropdown(profile.default.digital), "PIN"); .appendField(new Blockly.FieldDropdown(profile.default.digital), "PIN");
this.setOutput(true, Boolean); this.setOutput(true, 'Boolean');
this.setTooltip(''); this.setTooltip('');
} }
}; };
...@@ -87,9 +87,9 @@ Blockly.Blocks['io_analogwrite'] = { ...@@ -87,9 +87,9 @@ Blockly.Blocks['io_analogwrite'] = {
this.appendDummyInput("") this.appendDummyInput("")
.appendField("AnalogWrite PIN#") .appendField("AnalogWrite PIN#")
.appendField(new Blockly.FieldDropdown(profile.default.analog), "PIN"); .appendField(new Blockly.FieldDropdown(profile.default.analog), "PIN");
this.appendValueInput("NUM", Number) this.appendValueInput("NUM", 'Number')
.appendField("value") .appendField("value")
.setCheck(Number); .setCheck('Number');
this.setInputsInline(true); this.setInputsInline(true);
this.setPreviousStatement(true, null); this.setPreviousStatement(true, null);
this.setNextStatement(true, null); this.setNextStatement(true, null);
...@@ -116,7 +116,7 @@ Blockly.Blocks['io_analogread'] = { ...@@ -116,7 +116,7 @@ Blockly.Blocks['io_analogread'] = {
this.appendDummyInput("") this.appendDummyInput("")
.appendField("AnalogRead PIN#") .appendField("AnalogRead PIN#")
.appendField(new Blockly.FieldDropdown(profile.default.analog), "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'); this.setTooltip('Return value between 0 and 1024');
} }
}; };
...@@ -137,7 +137,7 @@ Blockly.Blocks['io_highlow'] = { ...@@ -137,7 +137,7 @@ Blockly.Blocks['io_highlow'] = {
this.setColour(230); this.setColour(230);
this.appendDummyInput("") this.appendDummyInput("")
.appendField(new Blockly.FieldDropdown([["HIGH", "HIGH"], ["LOW", "LOW"]]), 'BOOL') .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"); this.setTooltip("Set a pin state logic High or Low");
} }
}; };
......
...@@ -12,9 +12,9 @@ Blockly.Blocks['time_delay'] = { ...@@ -12,9 +12,9 @@ Blockly.Blocks['time_delay'] = {
helpUrl: 'http://arduino.cc/en/Reference/Delay', helpUrl: 'http://arduino.cc/en/Reference/Delay',
init: function() { init: function() {
this.setColour(120); this.setColour(120);
this.appendValueInput("DELAY_TIME", Number) this.appendValueInput("DELAY_TIME", 'Number')
.appendField("Delay") .appendField("Delay")
.setCheck(Number) .setCheck('Number')
.appendField("Milliseconds"); .appendField("Milliseconds");
this.setInputsInline(true); this.setInputsInline(true);
this.setPreviousStatement(true, null); this.setPreviousStatement(true, null);
...@@ -40,9 +40,9 @@ Blockly.Blocks['time_delaymicros'] = { ...@@ -40,9 +40,9 @@ Blockly.Blocks['time_delaymicros'] = {
helpUrl: 'http://arduino.cc/en/Reference/DelayMicroseconds', helpUrl: 'http://arduino.cc/en/Reference/DelayMicroseconds',
init: function() { init: function() {
this.setColour(120); this.setColour(120);
this.appendValueInput("DELAY_TIME_MS", Number) this.appendValueInput("DELAY_TIME_MS", 'Number')
.appendField("Delay") .appendField("Delay")
.setCheck(Number) .setCheck('Number')
.appendField("Microseconds"); .appendField("Microseconds");
this.setInputsInline(true); this.setInputsInline(true);
this.setPreviousStatement(true, null); this.setPreviousStatement(true, null);
...@@ -69,7 +69,7 @@ Blockly.Blocks['time_millis'] = { ...@@ -69,7 +69,7 @@ Blockly.Blocks['time_millis'] = {
this.setColour(120); this.setColour(120);
this.appendDummyInput("") this.appendDummyInput("")
.appendField("Elapsed Time (Milli)"); .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.'); this.setTooltip('Returns the number of milliseconds since the Arduino board began running the current program.');
} }
}; };
...@@ -92,7 +92,7 @@ Blockly.Blocks['time_micros'] = { ...@@ -92,7 +92,7 @@ Blockly.Blocks['time_micros'] = {
this.setColour(120); this.setColour(120);
this.appendDummyInput("") this.appendDummyInput("")
.appendField("Elapsed Time (Micro)"); .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.'); 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