Leap Motion

In this quick example, we're going to walk through the basic events the Leap Motion is capable of emitting.

We'll start off by loading up Cylon:

var Cylon = require('cylon');

With that done, we can start defining our robot:


We have a single connection + device combo for this bot, which will connect to the Leap Motion using the leapd daemon over WebSockets.

  connections: {
    leapmotion: { adaptor: 'leapmotion' }

  devices: {
    leapmotion: { driver: 'leapmotion' }

Easy as can be. For our work, we're going to log a simplified version of the data we get from the device.

  work: function(my) {
    my.leapmotion.on('frame', function(frame) {

    my.leapmotion.on('hand', function(hand) {

And with that all done, we can start: