Having a ball with code: Can Sphero inspire the next generation of developers?

Having a ball with code: Can Sphero inspire the next generation of developers?

Summary: Getting kids to code can be hard. Is a Bluetooth-connected robot ball part of the solution?

SHARE:

This is a software world: things we used to do with hardware are now handled by low-cost processors.

But that means we need more and more developers to write and maintain that code, but where are those developers coming from, when we're also told that the current educational system isn't teaching the essential skills needed to write code?

2013-03-27T16-18-41_1
Learn to code with a glowing ball? It might just work.

Luckily for the modern world there's something of a renaissance in the educational technology world and in the teaching of the basic building blocks of the computing.

You can start with visual programming environments like Kodu, and move on to more complex low-cost computing platforms like Raspberry Pi. But they're only part of the story.

More and more our world is becoming one where we're interacting with smart devices: not only that, it's one where devices are talking to each other.

Traditional programming techniques often flounder when you're dealing with asynchronous, machine-to-machine applications – and when you're working with real time systems and embedded processors.

Microcontrollers like Arduino or Netduino have changed the way we can teach device programming – but while they're ideal for intermediate and advanced programming, they don’t really encourage beginners.

That’s where a new generation of programmable objects is coming in. Perhaps best thought of as inhabiting a space somewhere between BigTrak (the drive train of which formed the basis of my first home-built robot) and Lego Mindstorms; they look like toys but are programmable objects in their own right, with tooling that ranges from smartphone Logo-like macro tools to whole SDKs.

Over the last couple of years there've been more and more of them at CES, products that were born as university research products or in small startups.

2013-03-27T16-18-41_0
You can start with Sphero's smartphone remote control...

I’ve been playing with Orbotix's Sphero for the last week or so. It's a small white ball, with a colour-changing LED light and an internal motor – and a Bluetooth connection to a smartphone or a tablet. You can drive it using a phone's touch screen as a remote control, or you can delve into its programming model. The cats may have enjoyed chasing a small bright light around the room, but I had a lot more fun exploring its development tools.

27-03-2013 16-19-39
...and end up on Github downloading SDKs.

Sphero's iPhone controller app is a free download, and contains links to a library of different apps - from games to apps that get you started coding. You can start programing the ball with a basic macro language app, with a simple visual programming language. It's more than a little reminiscent of the buttons on a BigTrak. You can choose to roll the ball forward, change its colour, and handle its rotation.

Where the Sphero macro differs from basic device programming environments, is its support for loops. Like the original Logo, and the turtle it controlled, you can wrap combinations of macros into basic loops, to create more complex functions. Sphero's macro language is extremely high level, so while your code takes advantages of the device's sensor suite to give it a much higher level of accuracy than you might expect, you don't get direct access to the data that Sphero sends back to the smartphone.

2013-03-27T16-15-51_0
Sphero's macro app comes with sample apps to get you writing simple control programs

Macro tools like this make it easy to teach basic programming and control constructs. Choosing to flash a pattern of colours and to drive a ball around an obstacle course teaches basic programming – especially once you start to add loops to simplify operations.

You can go a lot further than just basic macros with Sphero. SDKs are available for most of the main mobile operating systems, as well as for desktops and for HTML5-based cross-platform development environments. There are also plug-ins for game development platforms like Unity, making it easy to use Sphero as a target for augmented reality apps, making a moving ball a controller for games. You're also able to drill into the device’s sensors, giving you the ability to identify when it's moving, and where the device is relative to where it started.

The location API is what makes the Sphero a true robot. You can use it to get feedback on device position and status, letting you write apps that can give you true autonomous operation. The same tooling can also be used to use Sphero as a controller – adjusting its position to sample gyroscape and accelerometer.

Educational programming tools need to guide users from the very basic to the very complex – and that's something Sphero does well. You can start with it just as a smartphone linked toy, before progressing to macro-based programming. Then you can use the APIs to build HTML5 apps for any platform, with just a little JavaScript knowledge, before moving on to apps that run on major smartphone platforms, and finally taking advantage of the device's Bluetooth communications channel.

Much more than a toy, Sphero is a platform that grows with you, and one that entertains as well as informs (and also keeps the cats happy as you test out your code). It's not expensive at under £100, and with development resources held on Github it's easy to get started writing your own Sphero code. Like Kodu it starts small and game-like, capturing a child's attention and encouraging them to do more as they go.

It's exactly the type of tool we need to start building the next generation of robotics developers. 

Topics: Education, Software Development

Simon Bisson

About Simon Bisson

Simon Bisson is a freelance technology journalist. He specialises in architecture and enterprise IT. He ran one of the UK's first national ISPs and moved to writing around the time of the collapse of the first dotcom boom. He still writes code.

Kick off your day with ZDNet's daily email newsletter. It's the freshest tech news and opinion, served hot. Get it.

Talkback

1 comment
Log in or register to join the discussion
  • Thanks for the article

    Thank you Simon for digging deeper into Sphero. Most see a simple ball but it's a lot more sophisticated than an RC toy. Lately we have been teaching kids to program with orBasic. orbBasic is the old TRS-80 basic language ported to run on the ball. It lives between macros and the full SDK. It also gives kids access to the full sensor suite and is extremely simple to learn. In less than a few hours we have young students writing programs that use the sensor stack, for loops, and conditional statements such as if then else. Since the code runs on Sphero - the ball can be programmed to run without a phone connected. The only limitation is the programs are currently limited to about 1k since the memory on the ball is constrained. But in 1k or 100 or so lines of code you can create some sophisticated programs. I wrote an entire color matching game in 70 lines similar to the old Simon game - tilting the Sphero to match colors sequences that progressively got longer. We are passionate about making Sphero as open as possible - we figure the more than can program Sphero, the more Spheros will be sold - its how all consumer electronics should be designed.
    pberberian