Using the App

Setup

  1. Download the Sphero Edu App
  2. Select “I’m a Home User”
  3. Create a Sphero account
  4. Select “Sign up as a Learner”
  5. Enter your birthdate
  6. Agree to the Terms of Use

Note: You can create and edit programs through the Sphero Edu website, but you’ll need to use the Sphero app to actually run the code.


Creating a Program

For a full introduction, see this tutorial

Using the app:

  1. Sign into your account
  2. Navigate to the “Programs” tab. Any programs that you created on the website will also be visible here.
  3. Tap the “+” in the lower right corner to create a new program
  4. Create a name for your program, select a Program Type (either “Blocks” or “Text”), and choose “Sphero BOLT”.
Sphero App Screenshot
  1. Tap “Create”
  2. Start writing your program!

Using the website:

  1. Navigate to the Sphero Edu homepage
  2. Sign into your account
  3. Click on “My Content”
  4. Click “Create a Program”
  5. Create a name for your program, select a Program Type (either “Blocks” or “Text”), and choose “Sphero BOLT”
Sphero Edu Website Screenshots
  1. Click “Create”
  2. Start writing your program!

Your First Program

You can program your Sphero either by using Blocks or Javascript. Here are some resources to get started.

Javascript:

Blocks:


Connecting to your Sphero + Running your Code

  1. Place your Sphero on the charging dock. A solid blue light indicates that it is fully charged, and a flashing light indicates that it is still charging.
Charging Dock
  1. To connect to your Sphero, tap the icon in the upper right corner of the app:
App Icon
  1. Tap the robot to connect to it (the robot ID number can be found on the side of your Sphero)
Robot ID
  1. Wait for the Sphero to connect. It should display a blue light once it’s fully connected
Connected Sphero
  1. Now you’re ready to run your first program. In the app, navigate to the “Programs” tab and tap the program that you’d like to run. Then, tap “View Program”
Programs Tab
  1. Finally, tap “Start” to run the program

Additional Resources


Python Setup:

For a link to the Python Sphero documentation, see here: Sphero Edu Documentation or GitHub Repository

To install the library, run pip install spherov2. Python version >= 3.7 are supported.

You may also use this library: pysphero

Hello World:


import time
from spherov2 import scanner
from spherov2.sphero_edu import SpheroEduAPI
from spherov2.types import Color

toy = scanner.find_toy()
with SpheroEduAPI(toy) as api:
    api.set_main_led(Color(r=0, g=0, b=255))
    api.set_speed(60)
    time.sleep(2)
    api.set_speed(0)

api.spin(360, 1)
    

Moving your Sphero with arrow keys:

Note: This may need tweaking; feel free to add your own functionality

First, install the pynput library by running: pip install pynput


from spherov2 import scanner
from spherov2.sphero_edu import SpheroEduAPI
from pynput import keyboard
from spherov2.types import Color

toy = scanner.find_toy(toy_name="SB-F213") # Your name here
with SpheroEduAPI(toy) as api:
    # Visually show connection to Sphero
    api.set_main_led(Color(r=0, g=255, b=0))
    api.spin(360, 1)

up_pressed = False
down_pressed = False
left_pressed = False
right_pressed = False

api.set_heading(0)

def on_press(key):
    # PRESS ESCAPE 'esc' TO EXIT PROGRAM
    if key == keyboard.Key.esc:
        return False
      
    speed = 50

    global up_pressed
    global down_pressed
    global left_pressed
    global right_pressed
    if key == keyboard.Key.up and not up_pressed:
        up_pressed = True
        api.set_speed(speed)            
    elif key == keyboard.Key.down and not down_pressed:
        down_pressed = True
        api.set_heading(api.get_heading()+180)
        api.set_speed(speed)            
    if key == keyboard.Key.left and not left_pressed:
        left_pressed = True
        api.set_heading(api.get_heading()-45)
    if key == keyboard.Key.right and not right_pressed:
        right_pressed = True
        api.set_heading(api.get_heading()+45)

def on_release(key):
    global up_pressed
    global down_pressed
    global left_pressed
    global right_pressed

    if key == keyboard.Key.up:
        up_pressed = False
        api.set_speed(0)            
    elif key == keyboard.Key.down:
        down_pressed = False
        api.set_speed(0)            
    elif key == keyboard.Key.left:
        left_pressed = False            
    elif key == keyboard.Key.right:
        right_pressed = False

with keyboard.Listener(on_press=on_press, on_release=on_release) as listener:
    listener.join()