cylon/examples/halt/halt.js

28 lines
478 B
JavaScript

"use strict";
var Cylon = require("../..");
Cylon.robot({
connections: {
loopback: { adaptor: "loopback" }
},
devices: {
ping: { driver: "ping" }
},
work: function() {
after((1).second(), function() {
console.log("Hello human!");
console.log("I'm going to automatically stop in a few seconds.");
});
after((5).seconds(), function() {
console.log("I'm shutting down now.");
Cylon.halt();
});
}
});
Cylon.start();