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
7588cbcb
Commit
7588cbcb
authored
Feb 22, 2015
by
carlosperate
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added static typing to the arduino io blocks.
parent
9eac6619
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
blocks/arduino/io.js
blocks/arduino/io.js
+24
-0
No files found.
blocks/arduino/io.js
View file @
7588cbcb
...
...
@@ -50,6 +50,12 @@ Blockly.Blocks['io_digitalread'] = {
'
PIN
'
);
this
.
setOutput
(
true
,
'
Boolean
'
);
this
.
setTooltip
(
'
Reads the digital value of a pin.
'
);
},
/**
* Retrieves the type of return value for the block, in this case an integer.
*/
getType
:
function
(
existingVars
)
{
return
'
int
'
;
}
};
...
...
@@ -72,6 +78,12 @@ Blockly.Blocks['io_builtin_led'] = {
this
.
setPreviousStatement
(
true
,
null
);
this
.
setNextStatement
(
true
,
null
);
this
.
setTooltip
(
'
Turn on or off the built in LED.
'
);
},
/**
* Retrieves the type of return value for the block, in this case an integer.
*/
getType
:
function
(
existingVars
)
{
return
'
int
'
;
}
};
...
...
@@ -109,6 +121,12 @@ Blockly.Blocks['io_analogread'] = {
.
appendField
(
new
Blockly
.
FieldDropdown
(
profile
.
default
.
analog
),
'
PIN
'
);
this
.
setOutput
(
true
,
'
Number
'
);
this
.
setTooltip
(
'
Return value between 0 and 1024.
'
);
},
/**
* Retrieves the type of return value for the block, in this case an integer.
*/
getType
:
function
(
existingVars
)
{
return
'
int
'
;
}
};
...
...
@@ -126,5 +144,11 @@ Blockly.Blocks['io_highlow'] = {
'
STATE
'
)
this
.
setOutput
(
true
,
'
Boolean
'
);
this
.
setTooltip
(
"
Set a pin state logic High or Low.
"
);
},
/**
* Retrieves the type of return value for the block, in this case a boolean.
*/
getType
:
function
(
existingVars
)
{
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