How to use the leapjs.loop function in leapjs

To help you get started, we’ve selected a few leapjs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github charliegerard / leap_sphero / my_modules / sphero / index.js View on Github external
var controlSphero = function(spheroBall) {

    var controller = Leap.loop({frameEventName:'deviceFrame', enableGestures:true});

    controller.on('connect', function() {
    	console.log('connected to leap motion');
    });
    controller.on('ready', function() {
        console.log('ready');
    });
    controller.on('deviceStreaming', function() {
        console.log('device connected');
    });
    controller.on('deviceStopped', function() {
        console.log('device disconnected');
    });
    controller.on('frame', function(frame) {
      if(frame.hands[0]){
        var hand = frame.hands[0];
github charliegerard / leap_sphero / sphero_module / index.js View on Github external
const initLeapMotionConnection = () => {
  controller = Leap.loop({frameEventName:'deviceFrame', enableGestures:true});
  console.log('waiting for Leap Motion connection...');

  controller.connect();

  controller.on('connect', () => {
    console.log('connected to leap motion');
  });
  controller.on('ready', () => {
      console.log('ready');
  });
  controller.on('deviceStreaming', () => {
      console.log('device connected');
  });
  controller.on('deviceStopped', () => {
      console.log('device disconnected');
  });

leapjs

JavaScript client for the Leap Motion Controller

Apache-2.0
Latest version published 3 years ago

Package Health Score

54 / 100
Full package analysis