Hour of Code: Part 1

As part of Hour of Code this year, students in my Honors Physics class used the Sphero SPRK+ to tie together their study of motion from first semester.  They started with using the Sphero Edu App to simply draw tracks for the SPRK+ to follow and then look at both the data collected by the sensors and the JacaScript code produced.  (Note: In part 2, they will move onto using the native Sphero block language and then, during 2nd semester, will master Swift).

The students were given this information and this challenge.


The Sphero SPRK+ is a small, spherical robot that you can program through drawing, through the native Sphero programming language and through Swift, the Apple programming language.


The Sphero also collects the following data:


  • Location (cm)
  • Orientation (degrees)
  • Gyroscope (degrees/second)
  • Accelerometer (g)
  • Velocity (cm/sec)
  • Distance (cm)


In the first part of this activity, you will learn how to set up your Sphero as well as how to create a simple maze (and record data at the same time!).


Procedure: Connecting Your Sphero SPRK+

  1. The SPRK+ uses bluetooth to connect to the iPad.  You can also connect the SPRK+ to your phone as well.
  2. Open the Sphero Edu app on the iPad.
  3. Sign into your group’s Sphero EDU account.
  4. Connect your SPRK+ to your iPad by tapping Connect Robot
  5. Select the SPRK+.
  6. Bring your SPRK+ near the iPad.
  7. Tap on Programs and then tap + to create a new program.
  8. Tap on Draw and name your program appropriately.
  9. Sketch any generic shape, like a circle or square.  Tap Start and see what happens.  
  10. Clear this shape.
  11. Create any simple or advanced pattern you wish.  Remember, the greater the diameter, the wider the path.  So think carefully about the footprint of the SPRK+ you wish to create.
  12. Settle on a final design.  Run your SPRK+.
  13. Take an overhead video of the motion of the SPRK+.  Instagram it and send me the video separately.
  14. Screen capture your Sphero desktop and Air Drop it to me.


Your Sensor Data and the Code

  1. Tap on the 3 dots in the upper right corner.  Select Sensor Data.
  2. Look at your data.  What do you notice about the motion of the SPRK+ in the xy-plane?
  3. Tap Download  CSV data and air Drop it to me.
  4. Now tap JavaScript Code.
  5. Tap Copy Code and paste it into a Note.  Use // to add a comment with your group number at the top.  Air Drop the Note to me.

A short video



One of the Sketches

And some of the code


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s