Book Image

Building Smart LEGO MINDSTORMS EV3 Robots

By : Kyle Markland
Book Image

Building Smart LEGO MINDSTORMS EV3 Robots

By: Kyle Markland

Overview of this book

Smart robots are an ever-increasing part of our daily lives. With LEGO MINDSTORMS EV3, you can now prototype your very own small-scale smart robot that uses specialized programming and hardware to complete a mission. EV3 is a robotics platform for enthusiasts of all ages and experience levels that makes prototyping robots accessible to all. This book will walk you through six different projects that range from intermediate to advanced level. The projects will show you building and programming techniques that are used by engineers in the real world, which will help you build your own smart robot. You'll see how to make the most of the EV3 robotics platform and build some awesome smart robots. The book starts by introducing some real-world examples of smart robots. Then, we'll walk you through six different projects and explain the features that allow these robots to make intelligent decisions. The book will guide you as you build your own object-tracking tank, a box-climbing robot, an interactive robotic shark, a quirky bipedal robot, a speedy remote control race car, and a GPS-navigating robot. By the end of this book, you'll have the skills necessary to build and program your own smart robots with EV3.
Table of Contents (9 chapters)

Programming

Now we need to write a program that makes this smart tank move. We will be using EV3-G, the graphical programming language designed for the EV3.

Setting up the program

Before we start to write the program, we need to assign port numbers to both of the IR sensors. The program makes use of both of the IR sensors on the robot. The IR sensor that is mounted to the robot's chassis is plugged into port 1, so we will refer to this sensor as IR 1. The sensor mounted to the turret is plugged into port 2, so we will refer to that sensor as IR 2. It is imperative to remember this because the program identifies these sensors using their port numbers. We use the port numbers to tell the robot which sensor to check at any...