Book Image

Build and Code Creative Robots with LEGO BOOST

By : Ashwin Shah
Book Image

Build and Code Creative Robots with LEGO BOOST

By: Ashwin Shah

Overview of this book

LEGO BOOST is a feature-rich creative toolbox that helps kids to develop science, technology, engineering, and mathematics (STEM) skills in a fun way. The LEGO BOOST kit consists of motors, sensors, and more than 840 LEGO pieces to bring various multifunctional robots to life. This book will take you on an interesting and enjoyable journey where you will have fun building robots while developing your problem-solving and logical thinking skills. This book is an end-to-end guide that will take you from a beginner to expert level of robot building with LEGO BOOST and Scratch. Starting with the unboxing and a brief introduction to LEGO BOOST, you'll quickly get your first robotic model up and running. You'll understand how to use the electronic and non-electronic components and have fun building a range of intriguing robotics projects with increasing complexity and advanced functionality. Throughout the book, you'll work on a variety of amazing projects, such as building your own R2D2, a fictional character from Star Wars, that will pique your curiosity to learn robotics and help you explore the full potential of the LEGO BOOST kit. Once you've had fun working with the projects, you'll be introduced to an interesting challenge for you to solve by yourself! By the end of this book, you'll have gained the skills to build creative robotics projects with the LEGO BOOST creative toolbox, and have built on your logical thinking and problem-solving skills.
Table of Contents (20 chapters)
Bonus Chapters

Making the rover move

First, let's learn how to make our robot move straight by powering both motors at the same time. We will be using the same programming blocks that we used in Chapter 2, Building Your First BOOST Robot – Tabletop Fan, and Chapter 3, Moving Forward/Backward Without Wheels, but we will be selecting the AB option from the drop-down menu, as shown in the following screenshot. Here, I have written a program to make the robot go forward for two rotations at 100% speed:

Figure 4.28 – Selecting "AB" from the drop-down menu

Now that you know how to power both motors at the same time, let's write the main code:

Figure 4.29 – Sample program for forward programming

Now, let's perform a few activities.

Activity 1

Can you program your robot to do the following?

  1. Move forward for 2 seconds at 60% speed.
  2. Wait for 2 seconds and change the BOOST Hub light's color...