Hi, I wrote a mBot simulator in mBlock.
The simulator enables you to simulate the mBot behavior on the “scene” and toggling a variable it should send the commands to the real mBot, if one is connected to the mBlock.
I’m a spanish speaker so, the variable names and documentation is in spanish, but, code is code and should be a starting point for any one interested on the subject.
I’ll be pleased if any one use it and will answer any question you may have.
Firsts videos of old implementations
In this video, i start driving the mBot with the arrowkeys and watching the distance reported by the simulated ultrasonic senor and line follower. After a while i make visible a “stick sprite” whic i used to measure distances.
Then I switch the floor and run a line follower code.
This second video has me speaking explaining some inner workings of this old implementation, which do not change so much, but now, instead of multiple sprites and multiple threads I am using a single mBot object with multiple costumes. So just one thread for mBot object.
in this third video i was connected to another simulator via comm ports, so I toggle from sending commands to a mBot simulated in 3d space and simulating in 2d space with mBlock
This one is the last, with 2 mBot on scene
Here the code of a couple of examples: line follower and exit of a maze following the right wall
https://drive.google.com/open?id=1_hHvHkTTw7cSNK4dCYebu5p8wfuhKLVq
https://drive.google.com/open?id=12DyJKsjh4rSRdDlU2Q2TIr5N18_T-ibK
a guide of usage:
https://drive.google.com/open?id=1XmxHprKv25NH984fJLXccbAw-cRGssng
enjoy
Juan