Practice coding a Sphero RVR+ on the screen first. When your program works in the sim, copy it into Sphero Edu and run it on the real robot.
Tap any part of the map to learn what it does.
Blocks, JavaScript and Python all tell the robot the same thing. Here's a short program that drives until the color sensor sees red.
Notice the little differences: JavaScript uses setMainLed and curly braces, while Python uses set_main_led, a colon and indentation. In both, await goes in front of commands that take time, like roll, delay and speak.
Heading is the direction the robot faces. 0 is up on the arena, 90 is right, 180 is down and 270 is left. Click the compass to pick a heading, then move the sliders to see how far the robot would go.
In the sim, speed 255 is about 150 cm every second, and each arena grid square is 20 cm. Your real RVR+ may be a fair bit faster or slower, so measure it in Part 6 and the sim will match. Negative speeds drive backward.
When your program works in the sim, move it to the real robot. Check off each step as you go.
Tip: If the real robot goes a little too far or not far enough, change the seconds or the speed by a small amount and try again. That's normal: the sim is a practice field, not a perfect copy of your floor.
Every robot, battery and floor is a little different. Measure yours once, and your programs will drive about the same distance in the sim and on the floor.
Check your color cards too. Press “Copy color test”, run it on the robot, and slide a card under it. Your device says the color the robot sees. If it stays quiet or says the wrong color, try a brighter, plainer card or more light.
Your robot right now: the sim is using speed 255 = 150 cm/s, so speed 100 is about 59 cm/s. This page reads your number from the Sim Lab in this web browser.
| Thing | In the Sim Lab | On the real RVR+ |
|---|---|---|
| Commands | Named like Sphero Edu: roll, spin, setMainLed / set_main_led, getColor / get_color. | The same commands work, plus the isColor / is_color helper that “Copy for Sphero Edu” adds. |
| Distance | Speed 255 ≈ 150 cm/s, perfectly straight, and it starts and stops instantly. | Depends on your robot, floor and battery. Use Part 6 to match them. Real robots also take a moment to speed up. |
| Color sensor | Reads the colored tiles exactly. | Reads real colored cards. Lighting can shift the colors, so try the color test in Part 6. |
| Walls | The robot stops and the console says “Bump!” | The robot pushes into the wall. Give it plenty of space. |
| Numbers in Python | 10 / 2 prints 5. | 10 / 2 prints 5.0. The value is the same. |
| Speak | Shows a speech bubble. | Your device says the words out loud. |
| Saving | Your work saves in this web browser automatically. | Programs save to your Sphero Edu account. |
Make sure every block is snapped under when program starts. Loose blocks turn gray and don't run.
Lines that start a block, like if, while, for and def, must end with :. The lines under them need 4 spaces of indentation.
Check the color sensor inside a loop, with a very short delay, and stop right after the loop. A lower speed also helps the robot stop closer to the middle of the tile.
Your blocks are still saved. When you switch to “Write text”, the blocks pause because they can't read typed code. Press “From blocks” to go back to them. Your typed code is saved too, and it will be there when you come back to “Write text”. Only “Replace with code from blocks” replaces it.
The sim understands the Python most beginners use: variables, if/elif/else, while, for, functions, lists, tuples, dictionaries, slices, f-strings and print. A few advanced features, like classes, list comprehensions and try/except, only work in real Python.
await, or that I shouldn't use itCommands that take time, like roll, spin, delay and speak, need await in front, and await only works inside an async def. If you write your own async def go():, call it with await go(). The sim checks this so your program will work on the real robot too.
Measure your robot with the speed test in Part 6. After that, the sim will drive the same distance.
Progress is saved in the web browser you used. A different browser or device starts fresh.