Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
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 Learn to play with the LEGO MINDSTORMS Robot Inventor kit and build creative robots

Arrow left icon
Product type Paperback
Published in May 2021
Publisher Packt
ISBN-13 9781800568402
Length 438 pages
Edition 1st Edition
Concepts
Arrow right icon
Author (1):
Arrow left icon
Aaron Maurer Aaron Maurer
Author Profile Icon Aaron Maurer
Aaron Maurer
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Preface 1. Chapter 1: History of Mindstorms 2. Chapter 2: Getting Started with the Robot Inventor Kit FREE CHAPTER 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

For this build, we are going to focus on the remote app coding only. This will be a program that will allow you to control the robot using the remote-control feature of the app to move the claw right, left, up, and down, and to open and close the claw.

Overall, this program is fairly simple to develop and is created to be easily adaptable for you to remix to meet your needs. Use this sample code to make sure everything works, and then begin to tweak the code to make it work to your needs. Make sure you have the proper ports plugged in, and then move into the code.

Identifying the ports

If you have not plugged in your motors yet, then let's get them plugged in to the proper ports. You will plug the motor that moves the claw to the right and left to motor port C. The motor that controls the opening and closing of the claw will plug into port D. The two motors that control the arm of the claw to go up and down will use ports B and F. Once you have the motors...

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 $19.99/month. Cancel anytime