

Coding With Sphero
For this project, we worked with Sphero robots using the Lighting Lab iPad app. We were assigned to design a maze and code the robot to move through the maze.
Requirements for our maze:
-
At least five turns
-
At least one of the turns being something other than 90 degrees
-
Sphero should make a noise at each turn
-
Sphero should exclaim something when it reaches the end of the maze
What My Code Looks Like:
Here is My Sphero in Action:
NC Math Standards that Align With This Project:
2.MD.3 Estimate lengths using units of inches, feet, centimeters, and meters.
2.MD.1 Measure the length of an object by selecting and using appropriate tools such as rulers, yardsticks, meter sticks, and measuring tapes.
3.MD.7 Relate area to the operations of multiplication and addition.
4.MD.3 Apply the area and perimeter formulas for rectangles in real world and mathematical problems.
4.MD.6 Measure angles in whole number degrees using a protractor. Sketch angles of specified measure.
4.G.1 Draw points, lines, line segments, rays, angles (right, acute, obtuse), and perpendicular and parallel lines. Identify these in two-dimensional figures.
6.EE.9 Use variables to represent two quantities in a real-world problem that change in relationship to one another; write an equation to express one quantity, thought of as the dependent variable, in terms of the other quantity, thought of as the independent variable. Analyze the relationship between the dependent and independent variables using graphs and tables, and relate these to the equation.
My Problem Solving Approach:
My approach to the challenge of getting the Sphero to move through a maze began with me playing around with the iPad app, and coming up with a pattern that I liked. I came up with the following pattern: set color, roll, play sound, delay. I decided to change to a different color with each turn, and set the app to randomize what sound is played each time. After I came up with the pattern of effects for the Sphero to do, I roughly sketched out what I wanted my maze to look like.
When I built my maze, I had to adjust the speeds, degrees, and durations of each roll of my maze. For example, the first segment that my Sphero rolls was set to 0 degrees, for 4 seconds, at a speed of 41. For this length, which is above five feet long, the Sphero moves about 0.4 meters per second (meters/seconds). After setting up the maze on the floor, I let the Sphero move through the maze based on the lengths/degrees/speeds that I estimated, then I had to adjust the settings in order to keep the Sphero within the boundaries of the maze.
Because each one of the lengths of my maze is different, I had to adjust the speeds and durations of each roll, one by one. Although each length of my maze changes, I used the same basic strategy to get the Sphero to stay within the maze as it travelled along. This project required a great deal of trial and error, which was slightly frustrating at times, but mostly kept the project interesting!