Skip to content

Instantly share code, notes, and snippets.

@deadprogram
Created April 30, 2015 15:24
Show Gist options
  • Select an option

  • Save deadprogram/102c7239ef13367b303f to your computer and use it in GitHub Desktop.

Select an option

Save deadprogram/102c7239ef13367b303f to your computer and use it in GitHub Desktop.
"use strict";
var Cylon = require("cylon");
// ensure you install the API plugin first:
// $ npm install cylon-api-http
Cylon.api();
Cylon.robot({
name: "test",
commands: {
hello: this.hello,
},
connections: {
loopback: { adaptor: "loopback" }
},
devices: {
ping: { driver: "ping" }
},
hello: function() {
console.log("Hello");
return "ok"
},
work: function(my) {
every((1).seconds(), function() {
console.log("Hello, human!");
console.log(my.ping.ping());
});
after((5).seconds(), function() {
console.log("I've been at your command for 5 seconds now.");
});
}
});
Cylon.start();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment