Reader small image

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

Product typeBook
Published inJan 2022
PublisherPackt
ISBN-139781801811576
Edition1st Edition
Concepts
Right arrow
Author (1)
Aaron Maurer
Aaron Maurer
author image
Aaron Maurer

Aaron Maurer, also known as “Coffeechug” is the STEM lead for 21 school districts in Iowa helping to expand STEM, Computer Science, Makerspace, and Purposeful Play into classrooms K-12. Aaron is also a former FIRST LEGO League coach for 8 years with much success working with phenomenal kids. He has a Master Educator License with endorsements in 5-12 Psychology – 163; 5-12 World History – 166; 5-12 American History – 158; 5-12 Computer Science – 278; PK-12 Talented and Gifted – 107; 5-8 Middle School Generalist – 182; and K-8 Computer Science – 277. Currently, Aaron is a member of ISTE Making It Happen Award; Lego Education Ambassador and Master Educator; PBS Digital Innovator and All-Star; PITSCO Tag Committee; Microsoft Innovator Educator Expert; Microsoft Innovative Educator Fellow; Global Learning Mentor (formerly Skype Master Teacher); Minecraft Global Mentor; and Makey Makey Ambassador. Finally, Aaron was a finalist for the Iowa Teacher of the Year in 2014.
Read more about Aaron Maurer

Right arrow

Chapter 1: Getting Started with SPIKE Prime

In this chapter, we will be exploring the SPIKE Prime kit. It has over 500 elements to build robots, upgraded sensors, a new Intelligent Hub compared to previous versions of MINDSTORMS, and new programming platforms to bring our robots to life and control them.

Figure 1.1 – The front of the box when you get your hands on this amazing kit

To begin with, we are going to examine what the new elements are in this kit for us to build our designs with, how the sensors have changed, and the new Intelligent Hub. As we explore, we will take a closer look at some excellent features of this kit to start learning more about this LEGO MINDSTORMS product.

Finally, we will do some exploration of the new programming interface and how we use code to bring our ideas to life. The end goal of this chapter is to make sure you understand all possibilities and to build a foundation of basic knowledge of the kit to begin to build...

Technical requirements

One of the creative constraints when designing the builds in this book is to only use the parts, sensors, and elements contained in the kit. There will not be any additional parts needed to complete any of these builds. You will only need the SPIKE Prime Set 45678.

For software, you will need to download the LEGO SPIKE Prime software on either your computer, phone, or tablet. Please check the site to ensure your hardware and operating system are compatible with the software. You can get everything you need to set up by choosing LEGO Education SPIKE Prime on the LEGO site at https://education.lego.com/en-us/start.

For the building of the robot, all you will need is the SPIKE Prime kit. For programming, you will need the LEGO SPIKE application/software.

Access to the code can be found here: https://github.com/PacktPublishing/Design-Innovative-Robots-with-LEGO-SPIKE-Prime/blob/main/Ch%201%20Rock%20Paper%20Scissor.llsp.

You can find the code in action...

Overview of the kit

This kit comes with 523 elements to build, design, and bring your ideas to life.

When you open the plastic tub, you'll see two pieces of paper. The first one provides a layout of how LEGO Education suggests you organize the parts and elements in your tub. The second paper contains all the stickers to label and mark the trays, tubs, and elements.

Figure 1.2 – The layout diagram for all the elements

Next, you will find the inside of the box has the bottom of the tub to store the larger pieces and two smaller plastic sorting trays with stickers to better organize and sort your elements.

Figure 1.3 – Two smaller sorting trays to help organize and build more efficiently

The kit does not have a manual to build robots, but the software comes with a huge library collection of lessons, builds, and units to help a builder learn some new build techniques and to get started with building robots. It is...

Programming

When you boot up the software, you will have the choice to build robots using Essential or SPIKE Prime. Choose SPIKE Prime.

Figure 1.20 – Software provides platforms to choose from

If you need ideas, then head to https://education.lego.com/en-us/lessons?products=SPIKE%E2%84%A2+Prime+Set and you will get what you need from this page.

I find having the software on a computer or laptop for coding is quite helpful because of the larger screen and being able to store programs in my system. It is a good idea to have the software installed on your tablet because these are another good option depending on what you have available to use. Explore all the options to find what works best for you as a designer.

To get started, if you are brand new to the kit and LEGO robotics, then I suggest starting with the START menu option of the software to give you the option to get a quick overview of the sensors and builds and how they work with the Intelligent...

Creating a rock, paper, scissors wrist game

So far, you have been doing a lot of reading, so let's take time to do a quick build that covers some of the concepts shared about this new and exciting kit. You are going to build a fun little game of rock, paper, scissors that you can wear on your wrist.

You will need the following parts:

  • One Intelligent Hub
  • 16 black connector pins
  • One purple 7x11 open frame
  • Two black 5x7 open frames
  • Two black 9L beams
  • Two gray H connector brackets
  • Eight gray connector pins with a stop bush

Follow these steps to build the rock, paper, scissors wrist game:

  1. To start this build, find your Intelligent Hub.

    Figure 1.27 – Intelligent Hub

  2. Locate four black connector pins. Flip the Intelligent Hub onto its end and insert the four pins into the middle pin holes at the top and bottom of the hub.

    Figure 1.28 – Black pin connectors on the Intelligent Hub

  3. Locate your two black 5x7 open frame...

Coding a rock, paper, scissors wrist game

You are now going to code this wrist game to be able to randomly choose rock, paper, or scissors. You can play it against yourself or use it against another human. If you have a friend that has a kit, then you can both build one and compete this way. Start by opening up New Project and giving your project a name such as Rock Paper Scissors:

  1. Using the default yellow when program starts block, add a purple light block named write Hello. You will need to change the word from Hello to Left.

    Figure 1.34 – "Left" being programmed on the screen

  2. Add two yellow Events blocks named when Left Button pressed and when Right Button pressed.
  3. Go to the pink My Block sections of the coding blocks and make two new blocks. Name one start game and the other play again. Add these new blocks to the yellow blocks. Add the start game block for the left button and play again for the right button.

    Figure 1.35 – Decision making with...

Making your own game

Consider how you could take this simple and classic game and make it your own. Here are some suggestions that will allow you to use your own imagination and build up some skills as well:

  • Design your own icons for rock, paper, and scissors.
  • Convert this to a flip a coin (heads or tails) game.
  • Convert this game from rock, paper, scissors to the rolling of a die. Can you rewrite the code so when you shake the Intelligent Hub it mimics the random roll of a die?
  • Add an option where you can choose from the three games to play.

Summary

To wrap up this chapter, let's do a quick review of what we covered. We explored the overall look of the new LEGO SPIKE Prime kit. We examined the parts and elements that come with the kit along with the sensors. Additionally, we took some time to look at the programming software.

Now that we have a basic understanding of the kit and some featured elements, let's finally get to the building of robots. Let's take what we have learned and start building some fun, smart robots to challenge our thinking and creativity.

If you have not taken the time to build any of the other robot builds that are in the software, I would encourage you to take some time to build them and explore the ideas shared. None of these builds are required for the builds in this book, but they do provide a good foundation for the parts and building.

A few of these builds will reference certain builds to showcase how these ideas inspire new ideas.

In the next chapter, we will start...

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Design Innovative Robots with LEGO SPIKE Prime
Published in: Jan 2022Publisher: PacktISBN-13: 9781801811576
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.
undefined
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

Author (1)

author image
Aaron Maurer

Aaron Maurer, also known as “Coffeechug” is the STEM lead for 21 school districts in Iowa helping to expand STEM, Computer Science, Makerspace, and Purposeful Play into classrooms K-12. Aaron is also a former FIRST LEGO League coach for 8 years with much success working with phenomenal kids. He has a Master Educator License with endorsements in 5-12 Psychology – 163; 5-12 World History – 166; 5-12 American History – 158; 5-12 Computer Science – 278; PK-12 Talented and Gifted – 107; 5-8 Middle School Generalist – 182; and K-8 Computer Science – 277. Currently, Aaron is a member of ISTE Making It Happen Award; Lego Education Ambassador and Master Educator; PBS Digital Innovator and All-Star; PITSCO Tag Committee; Microsoft Innovator Educator Expert; Microsoft Innovative Educator Fellow; Global Learning Mentor (formerly Skype Master Teacher); Minecraft Global Mentor; and Makey Makey Ambassador. Finally, Aaron was a finalist for the Iowa Teacher of the Year in 2014.
Read more about Aaron Maurer