Mastering LEGO® MINDSTORMS Cover


Build Better Robots with Python and Word Blocks
by Barbara Bratzel and Rob Torok
October 2022, 136 pp.

You’ve learned the basics of LEGO® robotics, and now you’re ready for more. Mastering LEGO® MINDSTORMS teaches you everything you need to know to level up your robotics engineering skills, using examples compatible with the LEGO® MINDSTORMS Robot Inventor and SPIKE Prime sets. In no time, you’ll be programming autonomous robot vehicles, interactive games, LEGO® musical instruments, and more.

Rather than feature step-by-step instructions for building a handful of models, you’ll find essential information and expert tips and tricks for designing, building, and programming your own robotic creations. The book teaches the fundamentals of writing text-based code for your robots using the popular Python programming language; shows how to harness gears, linkages, and other mechanisms to create all kinds of motion; and explores sophisticated programming techniques for popular applications such as line following and obstacle avoidance, using both Python and Scratch-based Word Blocks. As you learn, loads of challenges and open-ended projects will inspire you to try out ideas.

Author Bio 

Barbara Bratzel is a K-8 STEM teacher who consults at the Center for Engineering and Education Outreach at Tufts University. She has been a keynote speaker and workshop leader at LEGO® robotics educational conferences around the world, and she’s the author of several robotics books for teachers, including Makerspace LEGO® (College House Books).

Rob Torok teaches Computer Science, Mathematics, and Engineering Design at a senior secondary school in Tasmania. He has run robotics workshops for teachers and students, and consulted for LEGO® Education Australia and the Center for Engineering and Education Outreach at Tufts University. He contributed a chapter to The LEGO® MINDSTORMS NXT Idea Book (No Starch Press).

Table of contents 

Chapter 1: Introduction to Python Programming
Chapter 2: Organizing Python Programs
Chapter 3: Efficient Python Programming with Variables, Lists, and Functions
Chapter 4: Controlling Motors and Sensors with Python
Chapter 5: Gears and Mechanisms
Chapter 6: Moving with the Gyro Sensor
Chapter 7: Avoiding Obstacles and Following Lines
Chapter 8: Playing Games
Chapter 9: Useful Inventions
Chapter 10: Ultimate Challenges


"Mastering LEGO® MINDSTORMS is a great resource for robot builders or FLL teams to advance their skills!"
—Joe Meno, BrickJournal

Extra Stuff 

Check out an interview with the authors on