Mbot gets disconected with servo


when running the below code Mbot gets disconnected.

But adding a wait between the two servo commands helps sometimes to not disconnect.
We have updated the extension pack to the latest version.


My first guess is that the batteries are weak


Thank you for the reply! We are connecting the mBot through the USB to computer. So, the power should be derived from that connection.

Is there anything else that could be an issue? Any help is appreciated.


Are the servos Makeblock 9g micro servos? They require a minimum of 4.8V and much prefer 6V. USB is 5V.

What is more important is amps. They use a lot of power (amps) and your code is constantly having them move from position 0 to 90 and back again. I would add a minimum one second wait between servo commands.

Your USB is probably not supplying enough amps to run everything. Turn the battery on.


Thank you for the suggestion. We did use batteries but perhaps they did not supply enough current as they weren’t fresh. We will try with new batteries.