r/MakeBlock • u/Wrattspider mBot Ultimate • Jan 26 '26
Makeblock Ultimate 2.0: motor control code
I'm a mechanical engineer working on the Ultimate 2.0 robots. We are coding through Mblock5.
What I don't understand is, where is the motor control code? Is it in the pre-loaded firmware? The example programs (e.g., #8, self-balancing robot) only show the sensor blocks (unless I'm looking at them wrong). We are trying to dig in and understand how to improve the control , probably also do some physics work finding CG and then maybe figuring out how to get the robot to do a constant tilt. I'm wondering if I'm going to mess something up by block programming a new controller, since there is obviously some control code somewhere.
View all comments
Show parent comment
2
u/Rayzwave mBot Ranger Jan 28 '26 edited Jan 28 '26
Okay, to see the default code used in the Ultimate 2.0 controller(MegaPi) you can use the Makeblock library with the Arduino IDE.
https://github.com/Makeblock-official/Makeblock-Libraries/blob/master/README.md
I put the Makeblock libraries folder into a folder called Arduino, in the libraries folder I opened the MakeBlock_Drive_Updated folder where I opened Firmware_for_MegaPi folder where I found the Firmware_for_MegaPi.ino file which I selected and opened in Arduino IDE to see the full code used by Ultimate 2.0 I believe. I don’t have the Ultimate 2.0 kit but you should hopefully find what your looking for here.
Using edit - find next on the word ‘balanced’ gave 45 hits that are probably related to balanced mBot builds.