Search icon
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Smart Robotics with LEGO MINDSTORMS Robot Inventor

You're reading from  Smart Robotics with LEGO MINDSTORMS Robot Inventor

Product type Book
Published in May 2021
Publisher Packt
ISBN-13 9781800568402
Pages 438 pages
Edition 1st Edition
Languages
Concepts
Author (1):
Aaron Maurer Aaron Maurer
Profile icon Aaron Maurer

Table of Contents (12) Chapters

Preface 1. Chapter 1: History of Mindstorms 2. Chapter 2: Getting Started with the Robot Inventor Kit 3. Chapter 3: Building an Industrial Robot Claw 4. Chapter 4: Building a LEGO Guitar 5. Chapter 5: Building a Scorpion 6. Chapter 6: Building a Solid Sumobot 7. Chapter 7: Building a Dragster 8. Chapter 8: Building an Egg and Ornament Decorator 9. Chapter 9: Creating Plankton from SpongeBob SquarePants – Part 1 10. Chapter 10: Creating Plankton from SpongeBob SquarePants – Part 2 11. Other Books You May Enjoy

Writing the code

The code for this project needs to solve a few key issues when it comes to sumobot battles and the strategy we are focusing on. Here are the three main goals of the code that you will be writing:

  • The robot needs to stop when it sees white to keep it from driving out of the arena.
  • The robot needs to detect when another robot is close so that it can push them forward and drive them out of the arena.
  • The robot needs to be steady and consistent to avoid any unnecessary movements that may cause our robot fall out of the arena.

Let's double-check our ports and start writing the code to achieve these goals.

The ports

Before you write your code, it is good to make sure all the motors and sensors are plugged in properly. Using Port View, you can double-check the proper ports. The wheel motors will need be plugged into ports E and F. The distance sensor needs to be plugged into port A. The color sensor will need to be plugged into port C.

...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}