Hour of Code, Part 2

For the second part of Hour of Code in Physics, students used the native Sphero language to program their SPRK+ through an “obstacle course” of their own design.  


3’ x 3’ square of white paper

Sphero SPRK+


Sphero Edu App

Blue painters tape

Terrain Park

Jump Ramps

Sphero Maze Tape


Sphero Block Language

The Sphero coding language is very much like Scratch.  Note: You can log into and edit your programs on your phone as well.  You cannot do it on your desktop.

Of importance to you for this activity are the following categories:

  • Movement (roll, stop, speed, heading, spin, raw motor, stabilization)
  • Light and Sound (Main LED, Sound, Speak, Fade, Strobe, Back LED)
  • Controls (Delay, Loop, Loop Forever, Loop Until, If Then, If Then Else, Exit Program)
  • Events (On Collision, On Land, On Freefall, On GyroMax, On Charging/Not Charging)

The Sphero language is tap, drag and drop.  From the block language, you can also get the JavaScript Code.

Steps to Success

While it is tempting to just start coding, planning your course and determining your code ahead of time will be very helpful.


  1. There is no right or wrong with this activity.  You are “right” if your code what you want it to do.  You are “wrong” if your code does not.
  2. You can have a “theme” if you so chose (i.e., “You’re watching Disney Channel”)
  3. If you need to work on this outside of class, please let me know in advance.
  4. Make sure you charge your SPRK+ and iPad at the end of every class.


By the end of class on Tuesday

  1. On a small piece of paper, sketch out the route for your SPRK+.  It should be to scale and it should include all obstacles and other events.
  2. Construct your obstacle course on the white paper.  
  3. Use Post Its to plot out what you need to code.  Using Post Its is helpful because you can move them around.  These two steps should be done before you start coding.

By the end of class on Thursday

  1. “Write” your code in your app.
  2. Begin testing your code.  Does your SPRK+ follow the route you want?

By the end of class on Monday

  1. Troubleshoot and finalize your code.

By the end of class on Wednesday

  1. Collect your data.

What To Turn In

  1. Screen capture of your program.  (Upload to Dropbox folder and Instagram)
  2. Overhead shot of your obstacle course.  (Upload to Dropbox folder and Instagram)
  3. Overhead video of your SPRK+ completing your course.  (Upload to Dropbox folder and Instagram)
  4. Your data (as a CSV file)  (Upload to Dropbox folder)
  5. Your JavaCode (copy and paste into a Google Doc and share it with me)

Make sure all of your documents are named:  17HPhysGroup#DocumentName.


Of Interest

I found it interesting to see how each section approached this activity.  One section focused on their obstacle course first, sketching it out and then figured out how to code it.  The other section started playing with functionality first and then developed an obstacle course based on their understanding of the functionality.


Sample Student Obstacle Course

One group based their course on the Disney Channel show, The Suite Life of Zack and Cody (which I renamed Zack and Coded).

Video of SPRK+


Sample Code

Where Do We Go From Here?

For many of the students in the class, they had no experience with coding.  So this set of activities gave them a solid introduction to coding.  And because these activities were done at the end of the semester and with no formal assessment, there was no stress for the students – they could simply just explore and “play.”

In two weeks, we’ll be heading down to the Apple Store for a workshop on coding with Swift.  This will set the stage for the final project for the course.  Stay tuned!




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