Commit badc28ac authored by carlosperate's avatar carlosperate

Added static typing to servo and spi blocks.

parent 19442b2b
...@@ -54,5 +54,11 @@ Blockly.Blocks['servo_read'] = { ...@@ -54,5 +54,11 @@ Blockly.Blocks['servo_read'] = {
.appendField(new Blockly.FieldDropdown(profile.default.pwm), 'SERVO_PIN'); .appendField(new Blockly.FieldDropdown(profile.default.pwm), 'SERVO_PIN');
this.setOutput(true, 'Number'); this.setOutput(true, 'Number');
this.setTooltip('Read a Servo angle'); this.setTooltip('Read a Servo angle');
},
/**
* Retrieves the type of the block, in this case an integer.
*/
getType: function() {
return 'int';
} }
}; };
...@@ -74,5 +74,13 @@ Blockly.Blocks['spi_transfer'] = { ...@@ -74,5 +74,13 @@ Blockly.Blocks['spi_transfer'] = {
this.setPreviousStatement(true, null); this.setPreviousStatement(true, null);
this.setNextStatement(true, null); this.setNextStatement(true, null);
this.setTooltip('Send SPI message to an specified slave device'); this.setTooltip('Send SPI message to an specified slave device');
},
/**
* Retrieves the type of the selected variable, Arduino code returns a byte,
* for now set it to integer..
* @this Blockly.Block
*/
getType: function() {
return "int";
} }
}; };
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