Here
- Fork and check out ArduBlock and our version of OpenBlocks
- Open both in the Eclipse
- The language description is located at ardublock/src/main/resources/com/ardublock/block/ardublock.xml
- To add a block, create a BlockGenus. We will use the “Digital Push Button” as an example here:
<BlockGenus name=”df_digital_push_button” kind=”data” color=”255 102 0″ initlabel=”bg.df_digital_push_button“>
<BlockConnectors>
<BlockConnector connector-type=”boolean” connector-kind=”plug”/>
<BlockConnector connector-type=”number” connector-kind=”socket” label=”bc.pin_number“>
<DefaultArg genus-name=”number” label=”1″/>
</BlockConnector>
</BlockConnectors>
<Images>
<Image>
<FileLocation>com/ardublock/block/dfrobot/dfr0029.jpg</FileLocation>
</Image>
</Images>
</BlockGenus>- Each block has a plug side expressing its data output. For the sensor block, it is either “boolean” or “number.”
- The socket sides of the block express the data needed for its function. In this case, the “pin” the button is attached.
- The image is located under src/main/resources and the relative path name to this directory should be used.
- all text in the attributes “initlabel” or “label” will get run through a localization process and the localized text are stored in “src/main/resources/com/ardublock/block/ardublock.properties” for English. Translation into other language is managed at the ArduBlock Translation.
-
Add the block to a Drawer.
<BlockDrawer button-color=”255 102 0″ name=”bd.dfrobot” type=”factory”>
<BlockGenusMember>df_digital_viberation_sensor</BlockGenusMember>
<BlockGenusMember>df_digital_infrared_motion_sensor</BlockGenusMember>
<BlockGenusMember>df_digital_ir_receiver_module</BlockGenusMember>
</BlockDrawer> - The code generation backend is located at src/main/java/com/ardublock/translator/block/
Hi David,
Thanks for this!
Can you quickly outline what edit-time / compile-time environment needs to be set up? On what type hosts?
Sorry, but I do not really understand the expected Tool Chain..
Regards, Terry King
…On the Mediterranean in Italy
terry@yourduino.com
Hi
I’ve integrated the src code of ardublocks into eclipse and i’ve tried to edit and add more features to tht and while execution m getting “Error: Could not find or load main class com.ardublock.Main” and after loading the main method also m getting the same error……Plzz help me!!!
Thanks in advance……….