Sphero Robot Experiments

  1. Compare the friction of different surfaces. Record the values that make the robot move accurately. 

 

Speed On carpet 

Number of seconds to travel 1 foot on the carpet 

Speed On the hard table 

Number of seconds to travel 1 foot on the table 

Slowest speed that will move without being pushed 

 

 

 

 

Fastest speed that will stop without sliding  

 

 

 

 

 

  1. Why doesn't program 1 on the left work, but programs 2 and 3 on the right do make the robot move in a square? 

Program 1 

Program 2 

Program 3 

(using blocks) 
Loop 4 times 

   Roll heading:90 speed:50 sec:1 

(using blocks) 
Dir = 90 
Loop 4 times 
   Roll heading: dir speed: 50 sec:1 
   dir = dir + 90 

async function startProgram() { 
 for (var dir = 0; dir<400; dir +=90 
{ roll(dir, 50, 1);} 

 

  1. Making turns 

What code will make the robot turn in a circle with about a 1' diameter? 

What code will make the robot turn in place 360 degrees without moving any other direction? 

 

 

 

Use the code and examples to help you complete the challenges. https://sphero.docsapp.io/docs/get-started  

 

  1. Write the JavaScript code to gradually fade the color of the robot's light from red to yellow over the span of 2 seconds. 

  2. What are the differences between the speak and sound commands? Can you make the robot make a sound and tell what the sound is? Write the code below: 

  3. Explain in detail what this program does: 

 

async function startProgram() { 

 setStabilization(false);  

 while (true) { 

     if ((Math.sqrt((getAcceleration().x ** 2) +        

                    (getAcceleration().y ** 2) + 

                    (getAcceleration().z ** 2)) > 1.4)) { 

        await speak(buildString("Shake"), false); 

        setMainLed({ r: 0, g: 255, b: 0 }); 

        await delay(1); 

        setMainLed({ r: 0, g: 0, b: 0 }); } 

 await delay(0.025); } 

 }