14
Robotic Macro Programming with Sphero Drake Myers [email protected] Jana Greenslit [email protected]

ramseycountymakerspace.files.wordpress.com€¦  · Web viewIntro to Sphero! Sphero is a nice little minimalist robot from Orbotix, Inc. There is a Sphero that looks like BB-8 from

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: ramseycountymakerspace.files.wordpress.com€¦  · Web viewIntro to Sphero! Sphero is a nice little minimalist robot from Orbotix, Inc. There is a Sphero that looks like BB-8 from

Robotic Macro Programming with

Sphero

Drake [email protected]

Jana [email protected]

www.rclreads.org

Page 2: ramseycountymakerspace.files.wordpress.com€¦  · Web viewIntro to Sphero! Sphero is a nice little minimalist robot from Orbotix, Inc. There is a Sphero that looks like BB-8 from

Teen Makerspace 

MaplewoodWednesdays 3-6 pm

 Roseville

Thursdays 3-5 pm

Maplewood Library3025 Southlawn DriveMaplewood, MN 55112

651-724-6003 

Mounds View Library2576 County Road 10

Mound View, MN 55109651-724-6004

 New Brighton

400 10th Street NWNew Brighton, MN 55112

651-724-6002 

Roseville Library

2180 N. Hamline AvenueRoseville, MN 55113

651-724-6001 

Shoreview Library4570 Victoria Street

Shoreview, MN 55126651-724-6006

 

2

Page 3: ramseycountymakerspace.files.wordpress.com€¦  · Web viewIntro to Sphero! Sphero is a nice little minimalist robot from Orbotix, Inc. There is a Sphero that looks like BB-8 from

Intro to Sphero!Sphero is a nice little minimalist robot from Orbotix, Inc. There is a Sphero that looks like BB-8 from Star Wars, but we have Sphero 2.0s.

Figure 1. A BB-8 Sphero on its contact charging pad.

They work with both Apple and Android devices, and so far every app that Sphero works with is free to download on the Apple App Store and the Google Play Store (for Androids).

Figure 2. A sphero 2.0 smart toy performing a sick jump. Little Spheros can do big things.

Okay, let’s start programming with…

3

Page 4: ramseycountymakerspace.files.wordpress.com€¦  · Web viewIntro to Sphero! Sphero is a nice little minimalist robot from Orbotix, Inc. There is a Sphero that looks like BB-8 from

Sphero MacroLab: How to Create Macros!

- Sphero Macrolab

The Sphero MacroLab app allows you to program the path of your Sphero. “Macros” are the specific paths or set of commands you create for Sphero to follow. The term means: a single instruction that expands automatically into a set of instructions to perform a particular task.

So, if you had a macro that made the Sphero go touch the wall and come back to you, you could easily tell the Sphero to do that action 40 times, or 40000 times!! That’d be cruel to poor Sphero, telling it to do that many laps.

4

Page 5: ramseycountymakerspace.files.wordpress.com€¦  · Web viewIntro to Sphero! Sphero is a nice little minimalist robot from Orbotix, Inc. There is a Sphero that looks like BB-8 from

Figure 3. A hooded figure, programming a wall. This isn’t much like programming at all, is it?

MacroLab VOCAB!Before we get started, let’s review some vocab. These are the basic moves that you have to choose from for your Macro:

Roll – the command that actually moves the Sphero – is probably going to be your most heavily used. For each roll, you will be able to change three settings: the speed, the heading, and the delay.Speed – You can set the speed on a scale of 0% to 100%. At 0%, the Sphero doesn’t move, and at 100% the Sphero moves its fastest.Heading – This is the angle at which the Sphero will move away from/toward you, and it is measured in the degrees of a circle, from 0 to 360.

When you set the Sphero down in front of you… At a heading setting of 0,

Sphero will move directly away from you.

At a setting of 90, Sphero will move to the right.

At a setting of 180, Sphero will move towards you.

At a setting of 270, Sphero will move to the left.

5

Page 6: ramseycountymakerspace.files.wordpress.com€¦  · Web viewIntro to Sphero! Sphero is a nice little minimalist robot from Orbotix, Inc. There is a Sphero that looks like BB-8 from

More MacroLab VOCAB!

RGB – Changes the color of Sphero’s light. Note that it’s additive color – meaning you’re mixing colors of light. See below to figure out how to mix red, green, and blue lights to create new colors.

Stop – Makes the Sphero stop rolling immediately

Delay – The amount of time the ball executes a command (re: the amount of time the ball waits to move onto the next command); measured in milliseconds. For example, if you set the delay to 2000 milliseconds, the ball will roll for 2 seconds.

6

Page 7: ramseycountymakerspace.files.wordpress.com€¦  · Web viewIntro to Sphero! Sphero is a nice little minimalist robot from Orbotix, Inc. There is a Sphero that looks like BB-8 from

Creating a Macro!1. Open up the MacroLab app. To create a new

Macro, tap the blue plus icon in the bottom right corner of the screen.

2. Type in a name for your Macro (i.e.: “square”, “maze”, etc.) and tap “Create Macro”.

3. To add commands to your Macro, tap the blue plus icon in the bottom right corner of the screen.

You may add multiple commands to a single macro. To test your Macro, tap the blue play icon at the bottom of the Macro’s main screen. Let’s practice creating Macros by programming Sphero to trace a square.

1. Create a new Macro and name it “Square.”

2. Before adding commands, be sure that Sphero will move in the right direction. Tap and hold the circle icon on the middle bottom of your screen, and move your finger around to rotate the Sphero until the blue light that appears inside the ball is facing you. This is the tail light, and Sphero will move in the opposite direction from this tail light when moving straight ahead.

3. Tap the + button to add a command. 4. Tap on Roll, the first command in the list. 5. Set the speed to 20, the delay to 2000 (2 seconds), and

leave the heading at zero. This will make the Sphero move away from you for 2 seconds. Tap “Create” at the top to add this command to your Macro.

7

Page 8: ramseycountymakerspace.files.wordpress.com€¦  · Web viewIntro to Sphero! Sphero is a nice little minimalist robot from Orbotix, Inc. There is a Sphero that looks like BB-8 from

6. Tap the play icon to test your Macro. The Sphero should move a short distance away from you.

7. Add a second roll to your Macro – now with a speed of 20, delay of 2000, and heading of 90. This will make your Sphero move to the right for 2 seconds.

8. Add a third roll – speed=20, delay=2000, heading=180. This will make the Sphero move towards you for 2 seconds.

9. Add a fourth roll – speed=20, delay=2000, heading=270. This will make the Sphero move to the left for 2 seconds.

10. Once you have added all of your rolls, tap the play icon to test your Macro. Your Sphero should roll in the pattern of a square!

Now, design a maze for others to beat:

8

Page 10: ramseycountymakerspace.files.wordpress.com€¦  · Web viewIntro to Sphero! Sphero is a nice little minimalist robot from Orbotix, Inc. There is a Sphero that looks like BB-8 from

Uses a BASIC programming language to interface with Sphero. More programming – YESSS!

-SPRK Lightning LabIt’s true- a SPRK programming app for Sphero, switch between block and Codea-like text coding! Nice!

- Sphero ColorGrab

A game of grabs – you grab Sphero when it lights up with your color!!!

-Flappyball for Sphero

A version of 'Flappy Bird' for Sphero?! No way!

More, More Sphero Apps!

-The Rolling Dead

10

Page 11: ramseycountymakerspace.files.wordpress.com€¦  · Web viewIntro to Sphero! Sphero is a nice little minimalist robot from Orbotix, Inc. There is a Sphero that looks like BB-8 from

Augmented reality game with zombies and fire. Just like that famous TV show, American Idol!

-Sharky the BeaverAugmented reality means that this beaver with a shark fin will walk around anywhere you point Sphero’s camera. Like a 3D Collector Platformer in real life!!

- Sphero Golf

Play golf with Sphero!!? This is how Tiger Woods practices, I bet!

- Sphero Draw N' Drive

Draw a path on the touch screen for Sphero to follow in real life!! Wow!

More, More, More Sphero Apps! 

11

Page 12: ramseycountymakerspace.files.wordpress.com€¦  · Web viewIntro to Sphero! Sphero is a nice little minimalist robot from Orbotix, Inc. There is a Sphero that looks like BB-8 from

- Sphero Cam

Take videos and pictures while controlling Sphero!! Try to catch sick tricks like Spike Jonze.

- Sphero Exile

Use Sphero as a motion controller in a top-down shoot-em-up game! Like Galaga, you know?

-Nyancat Space Party!

Based on the meme, a shoot-em-up game for Sphero. Is it a pop tart?

- Sphero Chromo

A game of matching–put your tilting skills and memory to the TEST!

12