Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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];
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');
});