Mbot Ranger Motors work in mblock but not Arduino IDE environment


I have used the Mbot rangers for 2 or 3 years now and managed to use the motors in both the mblock and Arduino IDE environments.

This year i have a new computer and i have installed the latest Arduino IDE, installed the makeblock library and the driver, however the motors just won’t work. All other features appear to work (RGBLed lightring, ultrasonic sensor, linefollower), but the motors do nothing.

The motors work fine via mblock online, and I have reset the firmware and tried to copy and paste the Ardunio code from mblock5 and paste into Arduino IDE and still it does not work.

Code compiles and uploads in Arduino IDE, and all other parts work, just the vehicle doesn’t move. Note: i have the vehicle using the battery pack to ensure there is enough power source and tested in mblock5 to be sure that this is not the issue.

Any suggestions on what might be the problem.
Thanks in advance for any help you can provide.

Ranger motors work fine in mBlock but not using Arduino IDE



Please share me the Arduino code which you upload.
I will test it on my side.


I can run the mblock online code and it works via mlink.
If i copy and paste the Arduino code from mblock online, and try to run via Arduino IDE it fails.
When i first open Arduino IDE i get error about a package but then the error goes away - my network admin are looking at this (so there is a chance there are some issues around permissions/firewall regarding - Error: downloading https://downloads.arduino.cc/packages/package_index.json).

But i can still paste the attached code into Arduino IDE, compile with no error, upload with no error, but motors don’t work (even though the same code works for block online). Sorry, not sure if i have uploaded correctly - did zip the .ino code which is a direct copy/paste of the Arduino code from mblock that does not execute motors when compile/upload via Arduino IDE. As i said the RGBLed light ring works, the linefollower works and the ultrasonic sensor works - i just can’t seem to get the motors to run.

CopyOfMblockCode.zip (765 Bytes)


I upload the code you offered and it did work properly.
I use arduino 1.8.8
Please make sure you choose the right port and board.



The right board and port have been selected, and everything compiles. I can successfully execute other code that communicates with the ultrasonic sensors, led light ring and the line follower. This piece of software compiles and executes, but the wheels don’t turn. Have checked to ensure enough power as wheels turn successfully when using mblock online code.

Have tried to roll back and use earlier versions of Arduino, and i have tried executing at work and at home to ensure it isn’t a proxy issue. We did have to update the proxy setting under nework in preferences for Arduino to auto-detect - could this cause an issue?

Had network guys look at it all incase permission issues - but they cannot find anything. Installed 1.8.8 onto a stand alone laptop then execute using hotspot via mobile to avoid any possible proxy issues, and still not working.

Can you confirm that the download of the makeblock library and drivers from the following website are all still valid and should work with 1.8.8 and newer versions of Arduino IDE.


I am now at a loss as to why this is not working given i have been able to use this successfully over the past 2 years. This is causing me quite a problem, as i am a senior secondary teacher using the mbot rangers for my senior students doing Digital Solutions subject. Any help is most appreciated.




You can also download the makeblock library from here.


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.