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
f95e3a4e
Commit
f95e3a4e
authored
Feb 23, 2015
by
carlosperate
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correcting accidental left over from cut and paste.
parent
badc28ac
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
11 additions
and
31 deletions
+11
-31
blocks/arduino/io.js
blocks/arduino/io.js
+4
-4
blocks/arduino/map.js
blocks/arduino/map.js
+0
-1
blocks/logic.js
blocks/logic.js
+0
-4
blocks/loops.js
blocks/loops.js
+1
-1
blocks/math.js
blocks/math.js
+1
-9
blocks/text.js
blocks/text.js
+0
-7
blocks/variables.js
blocks/variables.js
+3
-3
generators/arduino/math.js
generators/arduino/math.js
+2
-2
No files found.
blocks/arduino/io.js
View file @
f95e3a4e
...
...
@@ -54,7 +54,7 @@ Blockly.Blocks['io_digitalread'] = {
/**
* Retrieves the type of return value for the block, in this case an integer.
*/
getType
:
function
(
existingVars
)
{
getType
:
function
()
{
return
'
int
'
;
}
};
...
...
@@ -82,7 +82,7 @@ Blockly.Blocks['io_builtin_led'] = {
/**
* Retrieves the type of return value for the block, in this case an integer.
*/
getType
:
function
(
existingVars
)
{
getType
:
function
()
{
return
'
int
'
;
}
};
...
...
@@ -125,7 +125,7 @@ Blockly.Blocks['io_analogread'] = {
/**
* Retrieves the type of return value for the block, in this case an integer.
*/
getType
:
function
(
existingVars
)
{
getType
:
function
()
{
return
'
int
'
;
}
};
...
...
@@ -148,7 +148,7 @@ Blockly.Blocks['io_highlow'] = {
/**
* Retrieves the type of return value for the block, in this case a boolean.
*/
getType
:
function
(
existingVars
)
{
getType
:
function
()
{
return
'
int
'
;
}
};
blocks/arduino/map.js
View file @
f95e3a4e
...
...
@@ -40,7 +40,6 @@ Blockly.Blocks['base_map'] = {
/**
* Assigns a type to the block, the current map implementation for Arduino
* takes the inputs a longs and returns a long, so automatic cast to int.
* @this Blockly.Block
*/
getType
:
function
()
{
return
'
int
'
;
...
...
blocks/logic.js
View file @
f95e3a4e
...
...
@@ -330,7 +330,6 @@ Blockly.Blocks['logic_compare'] = {
},
/**
* Assigns a type to the block, comparison operations result in booleans.
* @this Blockly.Block
*/
getType
:
function
()
{
return
'
boolean
'
;
...
...
@@ -368,7 +367,6 @@ Blockly.Blocks['logic_operation'] = {
},
/**
* Assigns a type to the block, logic comparison operations result in bools.
* @this Blockly.Block
*/
getType
:
function
()
{
return
'
boolean
'
;
...
...
@@ -392,7 +390,6 @@ Blockly.Blocks['logic_negate'] = {
/**
* Assigns a type to the block, not input is meant to be a booleans, so it
* should return the same.
* @this Blockly.Block
*/
getType
:
function
()
{
return
'
boolean
'
;
...
...
@@ -417,7 +414,6 @@ Blockly.Blocks['logic_boolean'] = {
},
/**
* Assigns a type to the boolean block.
* @this Blockly.Block
*/
getType
:
function
()
{
return
'
boolean
'
;
...
...
blocks/loops.js
View file @
f95e3a4e
...
...
@@ -212,7 +212,7 @@ Blockly.Blocks['controls_for'] = {
* Retrieves the type of the selected variable, defined at getVarType.
* @this Blockly.Block
*/
getType
:
function
(
existingVars
)
{
getType
:
function
()
{
return
this
.
varType
;
}
};
...
...
blocks/math.js
View file @
f95e3a4e
...
...
@@ -140,7 +140,6 @@ Blockly.Blocks['math_single'] = {
},
/**
* Assigns a type to the block, all these operations are floats.
* @this Blockly.Block
*/
getType
:
function
()
{
return
'
float
'
;
...
...
@@ -183,7 +182,6 @@ Blockly.Blocks['math_trig'] = {
},
/**
* Assigns a type to the block, all these operations are floats.
* @this Blockly.Block
*/
getType
:
function
()
{
return
'
float
'
;
...
...
@@ -212,7 +210,6 @@ Blockly.Blocks['math_constant'] = {
},
/**
* Assigns a type to the block, all these operations are floats.
* @this Blockly.Block
*/
getType
:
function
()
{
return
'
float
'
;
...
...
@@ -287,7 +284,6 @@ Blockly.Blocks['math_number_property'] = {
},
/**
* Assigns a type to the block, all these operations return booleans.
* @this Blockly.Block
*/
getType
:
function
()
{
return
'
boolean
'
;
...
...
@@ -381,7 +377,7 @@ Blockly.Blocks['math_change'] = {
* Retrieves the type of the selected variable, defined at getVarType.
* @this Blockly.Block
*/
getType
:
function
(
existingVars
)
{
getType
:
function
()
{
return
this
.
varType
;
}
};
...
...
@@ -406,7 +402,6 @@ Blockly.Blocks['math_round'] = {
},
/**
* Assigns a type to the block, round always returns a float.
* @this Blockly.Block
*/
getType
:
function
()
{
return
'
float
'
;
...
...
@@ -480,7 +475,6 @@ Blockly.Blocks['math_modulo'] = {
},
/**
* Assigns a type to the block, modulus only works on integers.
* @this Blockly.Block
*/
getType
:
function
()
{
return
'
int
'
;
...
...
@@ -525,7 +519,6 @@ Blockly.Blocks['math_random_int'] = {
},
/**
* Assigns a type to the block, always an int.
* @this Blockly.Block
*/
getType
:
function
()
{
return
'
int
'
;
...
...
@@ -547,7 +540,6 @@ Blockly.Blocks['math_random_float'] = {
},
/**
* Assigns a type to the block, always a float.
* @this Blockly.Block
*/
getType
:
function
()
{
return
'
float
'
;
...
...
blocks/text.js
View file @
f95e3a4e
...
...
@@ -62,7 +62,6 @@ Blockly.Blocks['text'] = {
},
/**
* Assigns a type to the block, it always returns a string.
* @this Blockly.Block
*/
getType
:
function
()
{
return
'
String
'
;
...
...
@@ -196,7 +195,6 @@ Blockly.Blocks['text_join'] = {
},
/**
* Assigns a type to the block, it always returns a string.
* @this Blockly.Block
*/
getType
:
function
()
{
return
'
String
'
;
...
...
@@ -329,7 +327,6 @@ Blockly.Blocks['text_length'] = {
},
/**
* Assigns a type to the block, length always returns an integer number.
* @this Blockly.Block
*/
getType
:
function
()
{
return
'
int
'
;
...
...
@@ -352,7 +349,6 @@ Blockly.Blocks['text_isEmpty'] = {
},
/**
* Assigns a type to the block, empty check always returns a boolean.
* @this Blockly.Block
*/
getType
:
function
()
{
return
'
boolean
'
;
...
...
@@ -616,7 +612,6 @@ Blockly.Blocks['text_trim'] = {
},
/**
* Assigns a type to the block, trim always takes and returns a string.
* @this Blockly.Block
*/
getType
:
function
()
{
return
'
String
'
;
...
...
@@ -677,7 +672,6 @@ Blockly.Blocks['text_prompt'] = {
newQuote_
:
Blockly
.
Blocks
[
'
text
'
].
newQuote_
,
/**
* Assigns a type to the block, prompt always returns a string.
* @this Blockly.Block
*/
getType
:
function
()
{
return
'
String
'
;
...
...
@@ -717,7 +711,6 @@ Blockly.Blocks['text_prompt_ext'] = {
},
/**
* Assigns a type to the block, prompt always returns a string.
* @this Blockly.Block
*/
getType
:
function
()
{
return
'
String
'
;
...
...
blocks/variables.js
View file @
f95e3a4e
...
...
@@ -86,8 +86,8 @@ Blockly.Blocks['variables_get'] = {
options
.
push
(
option
);
},
/**
*
Assigns a type to the variable. In this case we n
eed to find the original
* variable set block
for the selected variable and set that typ
e.
*
Finds the type of the selected variable. N
eed to find the original
* variable set block
to save the type into the varType block variabl
e.
* @this Blockly.Block
* @param {Array<string>} existingVars List of variables already defined.
* @return {string} String to indicate the type if it has not been defined
...
...
@@ -124,7 +124,7 @@ Blockly.Blocks['variables_get'] = {
* Retrieves the type of the selected variable, defined at getVarType.
* @this Blockly.Block
*/
getType
:
function
(
existingVars
)
{
getType
:
function
()
{
return
this
.
varType
;
}
};
...
...
generators/arduino/math.js
View file @
f95e3a4e
...
...
@@ -234,9 +234,9 @@ Blockly.Arduino['math_number_property'] = function(block) {
/**
* Generator to add (Y) to a variable (X).
* If variable X has not been declared before this block it will be declared as
* a (not initialised) global int, however globals are 0 initialised in C/C++.
* Arduino code: loop { X += Y; }
* TODO: Might need to include "#define _USE_MATH_DEFINES"
* The arduino header file already includes math.h
* @param {!Blockly.Block} block Block to generate the code from.
* @return {array} Completed code with order of operation.
*/
...
...
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