Search icon CANCEL
Subscription
0
Cart icon
Cart
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
Arrow up icon
GO TO TOP
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
Toc

Table of Contents (12) Chapters close

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

You have this wonderful Plankton build and it is only cool if it indeed moves and interacts with the environment. This code will walk you through some ways to bring Plankton to life, while providing enough openness to be tweaked to your liking.

The code for this project is designed to achieve the following objectives:

  • Use two motors to create arm movement.
  • Use one motor to enable the head to turn.
  • Use one motor to open and close the mouth.
  • Use a color sensor to code voice or movements.
  • Use a distance sensor to trigger responses.

The ports

Before you dive into the code, let’s be sure that your motors and sensors are properly plugged into the proper ports. The neck motor, which will allow Plankton to move to the left and right, should be in port A. The motor that opens and closes the mouth needs to be in port C. The arms will be in ports D and E. The color sensor on the front of Plankton will be plugged into port F. Later,...

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 ₹800/month. Cancel anytime