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 Chapter 1: Getting Started with SPIKE Prime Chapter 2: Building an Industrial Robot Claw Chapter 3: Building a LEGO Guitar Chapter 4: Building a Mechanical Bird Chapter 5: Building a Sumobot Chapter 6: Building a Dragster Chapter 7: Building a Simon Says Game Other Books You May Enjoy

Coding Simon Says

You are going to code a game of Simon Says. The code will be broken down into six parts, as mentioned here:

  • Code stack 1 – main code
  • Code stack 2 – displaying images for player direction
  • Code stack 3 – displaying images and sound for game sequence
  • Code stack 4 – player input of answers
  • Code stack 5 – game over sequence
  • Code stack 6 – correct choice music sequence

All of the code is dependent on the gyro sensor built within the Intelligent Hub. Instead of using colors and external sensors, everything has been designed to use just the Intelligent Hub.

Let's begin!

Code stack 1 – main code

Please keep in mind that while you put this code stack together, some blocks may not work or make sense until you code out the rest of the code stacks. To ease the flow for you, I have decided to code by stacks.

The first part of this stack will clear and reset all the variables to...

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}