Taking Sphero for a math walk

Sphero walks a circle and a square

Sphero is an app-controlled ball that you can code. The code below was used to teach Sphero to walk a circle and a square (with orbBasic app). See the video.

Basic code for circle

10 locate 0,0
20 for x = 0 to 35
30    goroll 10*x,50,1
40    delay 100
50 next x
60 goroll 0,0,2

Basic code for square

10 locate 0,0
20 for x = 0 to 4
30    LEDC x
40    d = (x-1)*90
50    goroll d,100,1
60    delay 300
70    goroll d,0,2
80    delay 3000
90 next x

 

Coding help:

See orbBasic code definitions