Published mBot book today


Hi All,

I just published a short ebook on mBlock and the mBot (PDF right now, epub/mobi to follow soon) on Leanpub (link) if anyone is interested. All proceeds from the sales will go toward funding robotics teams to purchase hardware, software, etc.

The code for the book is at this link, but please consider buying the book to support the kids activities.

Minor update: I’ve pushed ePub and .mobi versions to the Leanpub link above. However, given the constraints of those formats, the PDF will provide the best reading experience. I’ve also published the book as a Kindle book on but you can get a $2.50 USD lower price on Leanpub (unless you want to throw the extra bucks to the kids robotics fund there).




Hi Chuck,

Great effort, love to check it out. Surely i will pick up something useful for my own teaching.
The mBot is part of my course, split half Scratch, half mBlock. I am composing a collection of mBlock-projects mainly for Me Orion. When it’s ready and translated from dutch, i will publish it on this forum (@tobor initiative)

Cheers, Albert


Hi Albert,

Glad to hear others are writing books! I’ve two more books in the mBot series that I need to write (one aimed at Arduino programming, the other sort of a project-based cookbook that will have Scratch and Arduino programs). I’ll look forward to your work as I’ll be starting to look at the Orion-based systems.

Best regards,



Update: The ebook is available in PDF, .ePub, and .mobi formats on Leanput (link) and .mobi on Amazon (link).


Purchased a copy yesterday, haven’t had a chance to read it, but I glazed at it and it looks rewarding.


Thanks, feel free to contact me if you have any questions.


Does your book have details on getting started from ground zero to actual programming with MBlock. My grandson and I have built a basic MBot and it works fine on the IPad with mBlockly but we can’t get the MBot to show up on MBlock on an Apple computer that seems to be connecting fine. All we can get is a Panda . Worst beginning instructions I have ever seen.



Past downloading and installing mBlock, the only tricky part is installing the Winchipahead USB driver. The Mac requires a signed driver and for a while there was only one available until one of the list members found the signed version on the Winchipahead site. When I installed mBlock under Windows, I didn’t see any major issues although I did have to install the USB driver for the Arduino. The Winchipahead USB chipset used by Makeblock doesn’t utilize FTDI, so you really have to install their driver.

My book is focused on mBlock programming for autonomous robotics, i.e., every program uses the mBot Program block rather than the When [green flag] Clicked block. However, I start by demonstrating how to turn an LED on and off and progress through a maze-solving robot program. Here’s the Table of Contents:

Table of Contents
Getting Set Up
The Software Development Process
Programming Guidelines
The mBlock Programming Environment
Blinking LEDs
Play An Octave
Press the Button
Light It Up!
Ultrasonic Theremin
Baby You Can Drive My Bot
Where’s My Line?
Robotic Movement Part 1
We Like to Move It!
Robotic Movement Part 2
Trace A Shape
Obstacle Avoidance
Bashin’ at the Basho
You Made It!
Appendix A: Flowcharts
Appendix B: mBot Blocks
Appendix C: Best Practices
Appendix D: Musical Note Values
Appendix E: Arduino Uno Specifications
Appendix F: Resources




I’m relieved to see someone has written a guide for mblock, does this book cover programming for the orion starter kit?

My son and I are desperate to learn more but we’re having a hard time finding the “ïdiots guide”

He wants to learn python, I just want to make the bot move!!

any advice appreciated


Hi George,

The first book is focused on the mBot and mBlock although likely some of it will translate for the Orion-based boards. I’m working on volume 2 which focuses more on Arduino programming and the mBot and will be starting on the Orion/Auriga book next summer. I’m hoping to get time to start the outline for the Orion/Auriga books early next year, but I’m coaching an FTC team right now which is eating up a lot of my “copious spare time”. :frowning:

Even with the Orion board though, once you have installed the driver, connected via the USB cable, and selected the proper port from the Connect menu, you should be able to make the motors move with a simple program in mBlock. I’ll try to look at it later today and post a simple move program.


I am an elementary school teacher and wondered if this would be a good guide for me to do a robot club with not much more than a background in blockly and a little dabbling in scratch?


It might be, although the book is aimed at 5th grade and up. The book assumes that the kids can handle the four basic math functions and how parentheses work. Otherwise, the first project is turning LEDs on and off and the book builds through subsequent projects to learn how the other sensors work and how movement works. The only other math that might be required would be calculating circumferences and that could be something that you pre-calculate for them. For elementary students, I’d recommend having them use a calculator unless they are familiar with calculating decimal numbers.

The mBlock programming environment is the Scratch 2.0 offline editor with extensions for the Makeblock boards. There is also an embedded Arduino compiler that the kids won’t need to deal with that compiles and loads the code to the mBot motherboard for autonomous operations.


Mr McKight,

I am using your book for my Tech Ed class and have done well up to Bashin at the Basho. I am stuck and can’t seem to find my mistake in coding. HELP! I’m using this on Friday and I don’t want to be nailed to the wall.
Bashin 2.sb2 (75.7 KB)



I see my file uploaded as a Scratch file so I’ve added a screenshot of my attempt at your code.


Hi! Could you tell me what is happening with the mBot? It’s difficult to know where to start without that information. :slight_smile:

I would suggest that you might want to download the working source code from this link and see if that exhibits the same defect.

I’m working through the code this week to correct the ultrasonic sensor checks for out of range. At the time the book was written, 0 indicated out of range for the ultrasonic sensor, but that has been changed to using a value of 400 for the ultrasonic sensor.


Hi Chuck!

I purchased GITR on Monday and devoured most of it that evening.It’s really exactly what I needed and well worth more than the $30.05 that I chose to pay for it! (hehe) Makeblock has some wonderful products and I’m very impressed with them, but the technical documentation leaves something to be desired. (Pandas and apples and mice, oh my.)

This is my first foray into graphical programming (learned Commodore and Apple flavors of BASIC as a kid, and then Turbo Pascal in tech school) so that was entirely new and different, then couple that with what you are greeted with upon loading MBLOCK and I was in a state of utter confusion. “Well, this can’t be right…”

Long story truncated, you saved me a lot of grief and I do appreciate it. I am now looking forward to turning my robot into a real boy instead of dreading it. The book is beautifully written and clear as can be, my only wish is that there was more of it! I proofread the first 100 or so pages and noted a few corrections in a text file here, if you are interested. (You seem like a thorough gentleman and I feel like I would be doing you a disservice if I did not mention the few very minor errors I noticed. I’ll proof the rest as well later when I re-read it.)

Anyway, thanks again. I’m sure I will have plenty of questions for you. I’d like my robot to be very human-centric and have some actual personality, and have some ideas on how I would like to achieve that. (He’s almost ready.) Your book was the real missing piece of the puzzle and in my opinion should be required reading for anyone who is even considering getting started with any of the Makeblock goodies. All the fundamentals are covered thoroughly and the examples are great, loved the format and also really liked the more philosophical tone about doing everything as neatly and efficiently and elegantly as possible, should be gospel for anyone coding anything, heh.

Much appreciated,




First, thanks for buying the book and your kind words. It’s my first effort as an author, and I appreciate anyone taking the time to pass on types, etc. so that I can correct the book and republish it. Right now I’m working on the follow-on volume that focuses on using the Arduino environment (C/C++). While some of the same themes will be repeated (maze solver, sumo bot), my goal is to provide a foundation for folks to build their confidence in writing programs for the mBot (and other Makeblock robots).

My major constraint has been finding the time to write since being drafted to coach a FIRST Technology Challenge robotics team. While it’s rewarding, it is quite a time-consuming effort and cuts deeply into my writing time. I’m running a robotics boot camp right now to ensure that all of the new members of the team are up and running for the upcoming 2017-18 season.

I’m usually lurking on the forums so feel free to post questions, and again, thanks for buying the book. The funds go to help the kids afford parts, etc.

Best regards,