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 Edu App
Blue painters tape
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)
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.
- 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.
- You can have a “theme” if you so chose (i.e., “You’re watching Disney Channel”)
- If you need to work on this outside of class, please let me know in advance.
- Make sure you charge your SPRK+ and iPad at the end of every class.
By the end of class on Tuesday
- 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.
- Construct your obstacle course on the white paper.
- 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
- “Write” your code in your app.
- Begin testing your code. Does your SPRK+ follow the route you want?
By the end of class on Monday
- Troubleshoot and finalize your code.
By the end of class on Wednesday
- Collect your data.
What To Turn In
- Screen capture of your program. (Upload to Dropbox folder and Instagram)
- Overhead shot of your obstacle course. (Upload to Dropbox folder and Instagram)
- Overhead video of your SPRK+ completing your course. (Upload to Dropbox folder and Instagram)
- Your data (as a CSV file) (Upload to Dropbox folder)
- Your JavaCode (copy and paste into a Google Doc and share it with me)
Make sure all of your documents are named: 17HPhysGroup#DocumentName.
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+
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!