Close

Phone as controller

A project log for 8BitRobots Module

A common hardware, software and 3D printed module to enable fun, educational robots anyone can print and program.

tim-wilkinsonTim Wilkinson 04/23/2018 at 05:220 Comments

If you own one of those cute Sphero toys, such as their R2D2 robot, then you're familiar with "phone as controller". There's a lot to like with this approach. I own various joysticks, gamepads, and RC controllers and they all have their place; but how many other people own them; or want to? Meanwhile we all own a phone with a touch screen.

The other big advantage of "phone as controller" is the versatile of the touch screen. Maybe the robot needs one joystick? Maybe two? Maybe a bunch of switches? Maybe specific information needs to be shown on the screen? How about the webcam video from the robot's "head"? The mobile phone is the idea places to put all of this, and arrange it in an appropriate, and fully customizable, way.

Each 8BitRobots node runs a small web server. This is used for a variety of things, but here it servers the web pages to the phone providing the visual controls. And because it's a web page, it runs anywhere, and it runs Javascript just like the rest of the robot. In fact, the controller is just another node in the robot.

Ultimately, the controller will be fully configurable, with the ability to drag and drop the necessary visual elements onto the screen depending on the robot's needs. Each control will accessible through the Blockly programming language just like everything else in the robot.

For example, a joystick will publish events with its 'x,y' position. A Blockly program can take this information and use it to control the wheels of a robot. Different visual configuration with different controls will result in different blocks being available, and let the developer program their robots in new ways.

The current controller is very simple, consisting of a joystick and compass. The position of everything is fixed. Over the coming months I'm building out the visuals and a more flexible system.

Discussions