Mastering LEGO® MINDSTORMS: Build Better Robots with Python and Word Blocks
Take your robotics skills to the next level with this guide to mastering LEGO® MINDSTORMS Robot Inventor and LEGO® SPIKE Prime.

You’ve learned the basics of LEGO® robotics with your Robot Inventor or SPIKE Prime kit, and now you’re ready for more. This full-color, illustrated guidebook to programming your robotic creations teaches you everything you need to know to level up your engineering skills, using examples relevant to both sets. In no time, you’ll be coding movements for autonomous robot vehicles, building interactive games, making 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.
1141287598
Mastering LEGO® MINDSTORMS: Build Better Robots with Python and Word Blocks
Take your robotics skills to the next level with this guide to mastering LEGO® MINDSTORMS Robot Inventor and LEGO® SPIKE Prime.

You’ve learned the basics of LEGO® robotics with your Robot Inventor or SPIKE Prime kit, and now you’re ready for more. This full-color, illustrated guidebook to programming your robotic creations teaches you everything you need to know to level up your engineering skills, using examples relevant to both sets. In no time, you’ll be coding movements for autonomous robot vehicles, building interactive games, making 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.
19.99 In Stock
Mastering LEGO® MINDSTORMS: Build Better Robots with Python and Word Blocks

Mastering LEGO® MINDSTORMS: Build Better Robots with Python and Word Blocks

by Barbara Bratzel, Rob Torok
Mastering LEGO® MINDSTORMS: Build Better Robots with Python and Word Blocks

Mastering LEGO® MINDSTORMS: Build Better Robots with Python and Word Blocks

by Barbara Bratzel, Rob Torok

Paperback

$19.99 
  • SHIP THIS ITEM
    In stock. Ships in 1-2 days.
  • PICK UP IN STORE

    Your local store may have stock of this item.

Related collections and offers


Overview

Take your robotics skills to the next level with this guide to mastering LEGO® MINDSTORMS Robot Inventor and LEGO® SPIKE Prime.

You’ve learned the basics of LEGO® robotics with your Robot Inventor or SPIKE Prime kit, and now you’re ready for more. This full-color, illustrated guidebook to programming your robotic creations teaches you everything you need to know to level up your engineering skills, using examples relevant to both sets. In no time, you’ll be coding movements for autonomous robot vehicles, building interactive games, making 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.

Product Details

ISBN-13: 9781718503144
Publisher: No Starch Press
Publication date: 10/25/2022
Pages: 136
Product dimensions: 8.06(w) x 10.00(h) x 0.28(d)

About the Author

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

Acknowledgments xiii

Introduction xv

Is this book for you? xv

Robot Inventor vs. SPIKE Prime xv

What to expect from this book xv

Why we wrote this book xvi

What's in this book xvi

Need a refresher? xvi

1 Introduction to Python programming 1

First steps 1

The console 1

The Help Center 2

The starting code 2

Controlling Hub outputs and inputs 3

Sounds 3

Light matrix 3

Status light 5

Hub buttons 5

Some programming basics 6

Indenting and spacing 6

Uppercase and lowercase letters 6

Use comments! 6

Printing to the console 7

Summary 7

2 Python control structures and operators 9

Control structures 9

Pausing a program 9

Looping 9

Conditionals 11

Keeping track of time 13

Operators 13

Arithmetic operators 13

Comparison operators 13

Logical operators 14

Summary 14

3 Efficient Python programming with variables, lists, and functions 17

Data types 17

Understanding common data types 17

Identifying data types 17

Variables and lists 18

Variables 18

Lists 19

Functions 20

Adding parameters 21

Returning a value 21

Summary 22

4 Controlling motors and sensors with Python 23

Programming motors 23

Controlling a single motor 23

Controlling two synchronized motors 24

Programming sensors 26

Color Sensor 26

Distance Sensor 27

Motion Sensor 28

Converting between floats and integers 30

The round() function 31

The floor() and ceil() functions 31

The floor division operator 31

The float() function 32

Summary 32

5 Gears and mechanisms 35

The basics of gears 35

Gearing up, gearing down 36

Compound gearing 36

Types of gears 38

Turntables 39

Differential assemblies 40

Useful mechanisms 41

Four-bar linkage 41

Cam 44

Ratchet and pawl 44

Scissor lift 45

Summary 46

6 Moving with the Gyro Sensor 49

Executing turns 49

Turn right 50

Turn left 51

Turn degrees 53

Turn in Python 54

Tracing shapes 54

A square 54

A triangle 55

Any regular polygon 55

A star 57

Summary 57

7 Avoiding obstacles and following lines 59

Getting ready 59

Turning to avoid obstacles 60

Stopping before an obstacle 62

The wrong way to do it 62

The right way to do it: a PID controller 64

Line following 68

A bang-bang approach 69

Smoother line following with proportional control 72

Getting even smoother with a PID controller 73

Tuning the PID controller 74

Summary 75

8 Playing games 79

Competitive clicking 79

One-player version 79

Two-player version 80

A reaction timer 81

Do this, do that! 84

Test your memory 86

Summary 90

9 Useful inventions 95

Inventions for children 95

High-shelf reacher 95

Smart name tag 96

Dependable pal 96

Household inventions 97

Pet helper 97

Robo cook 97

Smart appliance/furniture 99

Recycling robot 100

Inventions for plants 100

Seed disperser 100

Houseplant helper 101

Useless inventions 101

10 Ultimate challenges 103

Making music 103

Theremin 103

Color xylophone 104

Music box 104

Art 105

Spiro gyro 105

Framed art 106

Kinetic sculpture 107

Sports 107

Ball launcher 107

Ball over the wall 108

Tabletop robot 109

Security 109

Treasure box 109

Combination lock 110

Tripwire 111

Biomimicry 111

Cockroach 111

Robo pet 112

Build a bug 113

Index 115

From the B&N Reads Blog

Customer Reviews