Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
ardublockly
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
ardublockly
Commits
badc28ac
Commit
badc28ac
authored
Feb 23, 2015
by
carlosperate
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added static typing to servo and spi blocks.
parent
19442b2b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
+14
-0
blocks/arduino/servo.js
blocks/arduino/servo.js
+6
-0
blocks/arduino/spi.js
blocks/arduino/spi.js
+8
-0
No files found.
blocks/arduino/servo.js
View file @
badc28ac
...
...
@@ -54,5 +54,11 @@ Blockly.Blocks['servo_read'] = {
.
appendField
(
new
Blockly
.
FieldDropdown
(
profile
.
default
.
pwm
),
'
SERVO_PIN
'
);
this
.
setOutput
(
true
,
'
Number
'
);
this
.
setTooltip
(
'
Read a Servo angle
'
);
},
/**
* Retrieves the type of the block, in this case an integer.
*/
getType
:
function
()
{
return
'
int
'
;
}
};
blocks/arduino/spi.js
View file @
badc28ac
...
...
@@ -74,5 +74,13 @@ Blockly.Blocks['spi_transfer'] = {
this
.
setPreviousStatement
(
true
,
null
);
this
.
setNextStatement
(
true
,
null
);
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
"
;
}
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment