MBlock extension information request


#1

I try to add a new extension to mBlock and I want to understand the multiple examples available on the internet.
However I can not find / I can not understand some items.
For instance in the mbot.s2e file I read:

{ “extensionName”: “mBot”,
“extensionPort”: 0,
sort”:3, What types of sorts are available?
“firmware”:“1.2.103”,
“javascriptURL”:“js/mbot.js”,
isMakeBlockBoard”:true, what does this mean
"blockSpecs": [
[“h”,“mBot Program”,“runArduino”,{“src”:“mbot”,“inc”:"#include <MeMCore.h>\n",“def”:"",“setup”:"",“loop”:""}],
["-"],
[“w”, “%m.direction at speed %d.motorvalue”,“runBot”, “run forward”, 0,
{“encode":"{d0}{s1}",“setup”:”",“inc”:"",“def”:"",“work”:“move({0},{1});\n”,“loop”:""}], what does the encode mean?

The main question I have is where I can find this information, is it documented somewhere?


#2

E-J Have you tried downloading and installing the Demo extension that Makeblock has made available? I can get it to work when it’s generating a file that is uploaded to the Arduino, but not when trying the wireless mode. Here is the first description of the Demo extension. Go to that link and you will see how to download a zipped file with all the code. In the demo.s2e file, they explain some of the terms you are asking about. But I have not found a complete description of all the terms, and have yet to make an extension that works wirelessly. eric03


#3

Hi Eric03,

I’m fairly confident that to make your extension work in wireless mode, you would have to modify the firmware to include whatever features you’ve added in your extension. When in wireless mode, there is constant communications over the wireless link between the host computer and the mBot. In the communications to the mBot, new commands are sent to the mBot to perform an action, e.g. run forward at speed x. In the communications from the mBot, the mBot provides new status updates of the sensors it has.

/Aram


#4

Aram, Yes, you are correct. I have been modifying the mbot extension and find I need to do just what you are describing. For example, in the run forward command (that’s the one I am changing) I have modified it so that it starts the motors at the desired speed and direction and then runs for a specified period of time (so the bot makes a step (~15 cm) or a specific turn (# of degrees). My daughter is an elementary math teacher in Italy and wants to use the mbot to teach simple number line and geometry to 1st and 2nd graders). I also modified the firmware for that command (which is listed under JOYSTICK!) to turn on different LED’s for the various movements. This all works, but it has been slow because I couldn’t find a good description of how to make the changes. Just got a URL from MakeBlock tech support which provides a better description of how to make these changes, but haven’t digested it yet! Here is the URL: http://www.mblock.cc/posts/create-extensions-for-mblock
Good luck if you try this! And is you get into making or modifying extensions, I would be interested in that. Thanks for your reply. eric03