Skip to content

Instantly share code, notes, and snippets.

@zankich
Created May 13, 2014 09:48
Show Gist options
  • Select an option

  • Save zankich/dec89ecb660512a2ca8f to your computer and use it in GitHub Desktop.

Select an option

Save zankich/dec89ecb660512a2ca8f to your computer and use it in GitHub Desktop.
var Cylon = require('cylon');
Cylon.api({ host: '0.0.0.0', port: '8080' });
var MyRobot = (function() {
function MyRobot() {}
MyRobot.prototype.connection = {name: "drone", adaptor: "ardrone", port: "192.168.1.1"};
MyRobot.prototype.device = {name: "drone", driver: "ardrone"};
MyRobot.prototype.commands = ["relax", "energize"];
MyRobot.prototype.energize = function() {
this.drone.takeOff();
};
MyRobot.prototype.relax = function(cb) {
this.drone.land();
(cb)("I'm tired!");
};
MyRobot.prototype.work = function(me) {
console.log("I'm ready!");
};
return MyRobot;
})();
var robot = new MyRobot;
robot.name = "frankie";
Cylon.robot(robot);
Cylon.start();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment