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
67787801
Commit
67787801
authored
Feb 22, 2016
by
carlosperate
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reinstate the extra blocks, polish the examples, and remove test2.
parent
baf0c172
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
113 additions
and
118 deletions
+113
-118
ardublockly/ardublockly.js
ardublockly/ardublockly.js
+1
-1
blocks/blocks_data.json
blocks/blocks_data.json
+1
-12
blocks/grove/examples/joystick_servo.xml
blocks/grove/examples/joystick_servo.xml
+75
-0
blocks/grove/examples/temperature_serial.xml
blocks/grove/examples/temperature_serial.xml
+36
-26
blocks/test_2/blocks.js
blocks/test_2/blocks.js
+0
-25
blocks/test_2/blocks_config.json
blocks/test_2/blocks_config.json
+0
-12
blocks/test_2/generator_arduino.js
blocks/test_2/generator_arduino.js
+0
-19
blocks/test_2/msg/lang/en.js
blocks/test_2/msg/lang/en.js
+0
-0
blocks/test_2/msg/lang/es.js
blocks/test_2/msg/lang/es.js
+0
-0
blocks/test_2/msg/messages.js
blocks/test_2/msg/messages.js
+0
-23
No files found.
ardublockly/ardublockly.js
View file @
67787801
...
...
@@ -29,7 +29,7 @@ Ardublockly.init = function() {
// Inject Blockly into content_blocks and fetch additional blocks
Ardublockly
.
injectBlockly
(
document
.
getElementById
(
'
content_blocks
'
),
Ardublockly
.
TOOLBOX_XML
,
'
../blockly/
'
);
//
Ardublockly.importExtraBlocks();
Ardublockly
.
importExtraBlocks
();
Ardublockly
.
designJsInit
();
Ardublockly
.
initialiseIdeButtons
();
...
...
blocks/blocks_data.json
View file @
67787801
...
...
@@ -32,7 +32,7 @@
},
"test"
:
{
"categoryName"
:
"Test blocks"
,
"description"
:
"Test blocks to demonstrate th
e
feature."
,
"description"
:
"Test blocks to demonstrate th
is
feature."
,
"languages"
:
[
"en"
,
"es"
],
"toolboxName"
:
"Test"
,
"toolbox"
:
[
...
...
@@ -40,17 +40,6 @@
" <block type=
\"
ardublockly_name_top
\"
></block>"
,
"</category>"
]
},
"test_2"
:
{
"categoryName"
:
"Another Test blocks Section 2"
,
"description"
:
"Second test blocks to demonstrate the feature."
,
"languages"
:
[
"en"
,
"es"
],
"toolboxName"
:
"Test 2"
,
"toolbox"
:
[
"<category>"
,
" <block type=
\"
ardublockly_name_bottom
\"
></block>"
,
"</category>"
]
}
}
}
blocks/grove/examples/joystick_servo.xml
0 → 100644
View file @
67787801
<xml
xmlns=
"http://www.w3.org/1999/xhtml"
>
<block
type=
"arduino_functions"
x=
"11"
y=
"42"
>
<statement
name=
"LOOP_FUNC"
>
<block
type=
"variables_set"
>
<field
name=
"VAR"
>
angle
</field>
<value
name=
"VALUE"
>
<block
type=
"base_map"
>
<value
name=
"NUM"
>
<block
type=
"grove_joystick"
>
<field
name=
"AXIS"
>
0
</field>
<field
name=
"CONNECTOR"
>
A0
</field>
</block>
</value>
<value
name=
"DMAX"
>
<block
type=
"math_number"
>
<field
name=
"NUM"
>
180
</field>
</block>
</value>
</block>
</value>
<next>
<block
type=
"servo_write"
>
<field
name=
"SERVO_PIN"
>
9
</field>
<value
name=
"SERVO_ANGLE"
>
<block
type=
"variables_get"
>
<field
name=
"VAR"
>
angle
</field>
</block>
</value>
<next>
<block
type=
"controls_if"
>
<mutation
else=
"1"
></mutation>
<value
name=
"IF0"
>
<block
type=
"logic_compare"
>
<field
name=
"OP"
>
GT
</field>
<value
name=
"A"
>
<block
type=
"grove_joystick"
>
<field
name=
"AXIS"
>
0
</field>
<field
name=
"CONNECTOR"
>
A0
</field>
</block>
</value>
<value
name=
"B"
>
<block
type=
"math_number"
>
<field
name=
"NUM"
>
1000
</field>
</block>
</value>
</block>
</value>
<statement
name=
"DO0"
>
<block
type=
"grove_led"
>
<field
name=
"CONNECTOR"
>
4
</field>
<value
name=
"STATE"
>
<block
type=
"io_highlow"
>
<field
name=
"STATE"
>
HIGH
</field>
</block>
</value>
</block>
</statement>
<statement
name=
"ELSE"
>
<block
type=
"grove_led"
>
<field
name=
"CONNECTOR"
>
4
</field>
<value
name=
"STATE"
>
<block
type=
"io_highlow"
>
<field
name=
"STATE"
>
LOW
</field>
</block>
</value>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
</xml>
\ No newline at end of file
blocks/grove/examples/temperature_serial.xml
View file @
67787801
<xml
xmlns=
"http://www.w3.org/1999/xhtml"
>
<block
type=
"serial_setup"
x=
"
81"
y=
"18
"
>
<block
type=
"serial_setup"
x=
"
21"
y=
"45
"
>
<field
name=
"SERIAL_ID"
>
Serial
</field>
<field
name=
"SPEED"
>
9600
</field>
</block>
<block
type=
"serial_print"
x=
"81"
y=
"124"
>
<block
type=
"arduino_functions"
x=
"21"
y=
"111"
>
<statement
name=
"SETUP_FUNC"
>
<block
type=
"serial_print"
>
<field
name=
"SERIAL_ID"
>
Serial
</field>
<field
name=
"NEW_LINE"
>
TRUE
</field>
<value
name=
"CONTENT"
>
<block
type=
"text"
>
<field
name=
"TEXT"
>
The temperatues are displayed in Centigrades:
</field>
</block>
</value>
</block>
</statement>
<statement
name=
"LOOP_FUNC"
>
<block
type=
"serial_print"
>
<field
name=
"SERIAL_ID"
>
Serial
</field>
<field
name=
"NEW_LINE"
>
TRUE
</field>
<value
name=
"CONTENT"
>
<block
type=
"text_join"
>
<mutation
items=
"3
"
></mutation>
<mutation
items=
"2
"
></mutation>
<value
name=
"ADD0"
>
<block
type=
"text"
>
<field
name=
"TEXT"
>
Temperature is:
</field>
...
...
@@ -19,11 +32,6 @@
<field
name=
"CONNECTOR"
>
A1
</field>
</block>
</value>
<value
name=
"ADD2"
>
<block
type=
"text"
>
<field
name=
"TEXT"
>
ºC
</field>
</block>
</value>
</block>
</value>
<next>
...
...
@@ -36,4 +44,6 @@
</block>
</next>
</block>
</statement>
</block>
</xml>
\ No newline at end of file
blocks/test_2/blocks.js
deleted
100644 → 0
View file @
baf0c172
/**
* @license Licensed under the Apache License, Version 2.0 (the "License"):
* http://www.apache.org/licenses/LICENSE-2.0
*/
/**
* @fileoverview Ardublockly JavaScript for the Blockly resources and bindings.
*/
'
use strict
'
;
goog
.
provide
(
'
Blockly.Blocks.test2
'
);
goog
.
require
(
'
Blockly.Blocks
'
);
Blockly
.
Blocks
.
test2
.
HUE
=
180
;
/* Ardublockly logo block */
Blockly
.
Blocks
[
'
ardublockly_name_bottom
'
]
=
{
init
:
function
()
{
this
.
appendDummyInput
()
.
appendField
(
Blockly
.
Msg
.
BLOCKS_TEST_2_
);
this
.
setPreviousStatement
(
true
);
this
.
setColour
(
Blockly
.
Blocks
.
test2
.
HUE
);
}
};
blocks/test_2/blocks_config.json
deleted
100644 → 0
View file @
baf0c172
{
"categoryName"
:
"Another Test blocks Section 2"
,
"description"
:
"Second test blocks to demonstrate the feature."
,
"languages"
:
[
"en"
,
"es"
],
"toolboxName"
:
"Test 2"
,
"toolbox"
:
[
"<category>"
,
" <block type=
\"
ardublockly_name_bottom
\"
></block>"
,
"</category>"
]
}
blocks/test_2/generator_arduino.js
deleted
100644 → 0
View file @
baf0c172
/**
* @license Licensed under the Apache License, Version 2.0 (the "License"):
* http://www.apache.org/licenses/LICENSE-2.0
*/
/**
* @fileoverview Code generator for the test 2 blocks.
*/
'
use strict
'
;
goog
.
provide
(
'
Blockly.Arduino.test2
'
);
goog
.
require
(
'
Blockly.Arduino
'
);
/** . */
Blockly
.
Arduino
[
'
ardublockly_name_bottom
'
]
=
function
(
block
)
{
return
''
;
};
blocks/test_2/msg/lang/en.js
deleted
100644 → 0
View file @
baf0c172
blocks/test_2/msg/lang/es.js
deleted
100644 → 0
View file @
baf0c172
blocks/test_2/msg/messages.js
deleted
100644 → 0
View file @
baf0c172
/**
* @license Licensed under the Apache License, Version 2.0 (the "License"):
* http://www.apache.org/licenses/LICENSE-2.0
*/
/**
* @fileoverview English strings for test blocks. All names have the postfix
* BLOCKS_{category} from the blocks_config.json data.
*/
'
use strict
'
;
goog
.
require
(
'
Blockly.Msg.en
'
);
/**
* Due to the frequency of long strings, the 80-column wrap rule need not apply
* to message files.
*/
/// Toolbox category name
Blockly
.
Msg
.
BLOCKS_TEST_CATEGORY
=
'
Test
'
;
/// Ardublockly name
Blockly
.
Msg
.
BLOCKS_TEST_2_
=
'
Ardublockly
'
;
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