Created
June 29, 2015 20:37
-
-
Save Drenerdo/d1afccd116833defe715 to your computer and use it in GitHub Desktop.
Work IN Progress
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Cylon = require('cylon'); | |
Cylon.api({ | |
host: '0.0.0.0', | |
port: '7000', | |
ssl: false | |
}); | |
Cylon.robot({ | |
name: 'drenerdo', | |
connections: { | |
pebble: { adaptor: 'pebble' }, | |
ardrone: { adaptor: 'ardrone', port: '192.168.1.1'} | |
}, | |
devices: { | |
pebble: { adaptor: 'pebble' }, | |
drone: { driver: 'ardrone'} | |
}, | |
work: function(my) { | |
my.pebble.pending_message("Starting Drone Awesomeness"); | |
my.pebble.on('button', function(data){ | |
console.log("Button pushed:" + data); | |
if(data.localeCompare('up')===0) { | |
my.drone.animateLeds('blinkGreenRed'); | |
my.drone.takeoff(); | |
return; | |
} | |
my.drone.animateLeds('fire', 5, 2); | |
my.drone.land(); | |
my.drone.stop(); | |
return; | |
}); | |
my.pebble.on('tap', function() { | |
console.log("Tap event detected!"); | |
}); | |
} | |
}).start(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment