Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Design Innovative Robots with LEGO SPIKE Prime

You're reading from  Design Innovative Robots with LEGO SPIKE Prime

Product type Book
Published in Jan 2022
Publisher Packt
ISBN-13 9781801811576
Pages 264 pages
Edition 1st Edition
Languages
Concepts
Author (1):
Aaron Maurer Aaron Maurer
Profile icon Aaron Maurer

Table of Contents (9) Chapters

Preface 1. Chapter 1: Getting Started with SPIKE Prime 2. Chapter 2: Building an Industrial Robot Claw 3. Chapter 3: Building a LEGO Guitar 4. Chapter 4: Building a Mechanical Bird 5. Chapter 5: Building a Sumobot 6. Chapter 6: Building a Dragster 7. Chapter 7: Building a Simon Says Game 8. Other Books You May Enjoy

Writing the code

The coding for the guitar is very simple in premise but allows for completely individual interpretation of how you want to play the guitar and how you want the guitar to sound.

The program we are writing as an example will showcase some possibilities, but in the end, be brave and tinker around to get the guitar to sound like you want it. The beauty of music is that it allows you to express yourself the way you want to express yourself. This is your moment! Combining coding and music is an exciting combination of awesome.

The ports

There is not a lot to plug in for this build. You will connect the force sensor into port D and plug the color sensor into port C:

Figure 3.32 – The port view in the Mindstorms software

The basic layout of the program will follow this structure for each of the colored items on your guitar fretboard.

You will start by deleting the default yellow event block called when program starts. Right-click...

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