Commit 67787801 authored by carlosperate's avatar carlosperate

Reinstate the extra blocks, polish the examples, and remove test2.

parent baf0c172
...@@ -29,7 +29,7 @@ Ardublockly.init = function() { ...@@ -29,7 +29,7 @@ Ardublockly.init = function() {
// Inject Blockly into content_blocks and fetch additional blocks // Inject Blockly into content_blocks and fetch additional blocks
Ardublockly.injectBlockly(document.getElementById('content_blocks'), Ardublockly.injectBlockly(document.getElementById('content_blocks'),
Ardublockly.TOOLBOX_XML, '../blockly/'); Ardublockly.TOOLBOX_XML, '../blockly/');
//Ardublockly.importExtraBlocks(); Ardublockly.importExtraBlocks();
Ardublockly.designJsInit(); Ardublockly.designJsInit();
Ardublockly.initialiseIdeButtons(); Ardublockly.initialiseIdeButtons();
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
}, },
"test": { "test": {
"categoryName": "Test blocks", "categoryName": "Test blocks",
"description": "Test blocks to demonstrate the feature.", "description": "Test blocks to demonstrate this feature.",
"languages": ["en", "es"], "languages": ["en", "es"],
"toolboxName": "Test", "toolboxName": "Test",
"toolbox": [ "toolbox": [
...@@ -40,17 +40,6 @@ ...@@ -40,17 +40,6 @@
" <block type=\"ardublockly_name_top\"></block>", " <block type=\"ardublockly_name_top\"></block>",
"</category>" "</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>"
]
} }
} }
} }
<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
<xml xmlns="http://www.w3.org/1999/xhtml"> <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="SERIAL_ID">Serial</field>
<field name="SPEED">9600</field> <field name="SPEED">9600</field>
</block> </block>
<block type="serial_print" x="81" y="124"> <block type="arduino_functions" x="21" y="111">
<field name="SERIAL_ID">Serial</field> <statement name="SETUP_FUNC">
<field name="NEW_LINE">TRUE</field> <block type="serial_print">
<value name="CONTENT"> <field name="SERIAL_ID">Serial</field>
<block type="text_join"> <field name="NEW_LINE">TRUE</field>
<mutation items="3"></mutation> <value name="CONTENT">
<value name="ADD0">
<block type="text"> <block type="text">
<field name="TEXT">Temperature is: </field> <field name="TEXT">The temperatues are displayed in Centigrades:</field>
</block>
</value>
<value name="ADD1">
<block type="grove_temperature">
<field name="CONNECTOR">A1</field>
</block>
</value>
<value name="ADD2">
<block type="text">
<field name="TEXT"> ºC</field>
</block> </block>
</value> </value>
</block> </block>
</value> </statement>
<next> <statement name="LOOP_FUNC">
<block type="time_delay"> <block type="serial_print">
<value name="DELAY_TIME_MILI"> <field name="SERIAL_ID">Serial</field>
<block type="math_number"> <field name="NEW_LINE">TRUE</field>
<field name="NUM">500</field> <value name="CONTENT">
<block type="text_join">
<mutation items="2"></mutation>
<value name="ADD0">
<block type="text">
<field name="TEXT">Temperature is: </field>
</block>
</value>
<value name="ADD1">
<block type="grove_temperature">
<field name="CONNECTOR">A1</field>
</block>
</value>
</block> </block>
</value> </value>
<next>
<block type="time_delay">
<value name="DELAY_TIME_MILI">
<block type="math_number">
<field name="NUM">500</field>
</block>
</value>
</block>
</next>
</block> </block>
</next> </statement>
</block> </block>
</xml> </xml>
\ No newline at end of file
/**
* @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);
}
};
{
"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>"
]
}
/**
* @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 '';
};
/**
* @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';
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