Merge branch 'master' into remove-node-namespace
* master: Remove Logger usage from examples
This commit is contained in:
commit
90e6ab5564
|
@ -38,7 +38,7 @@ SkynetBot = (function(){
|
|||
}
|
||||
});
|
||||
|
||||
Logger.info("Skynet instance `" + my.name + "` is listening ...");
|
||||
console.log("Skynet instance `" + my.name + "` is listening ...");
|
||||
};
|
||||
|
||||
return SkynetBot;
|
||||
|
|
|
@ -22,7 +22,7 @@ skynet = {
|
|||
],
|
||||
|
||||
work: function(my) {
|
||||
Logger.info("Skynet is listening...");
|
||||
console.log("Skynet is listening...");
|
||||
|
||||
my.skynet.on('message', function(data) {
|
||||
console.log(data);
|
||||
|
|
|
@ -1,8 +1,18 @@
|
|||
var Cylon = require('../..');
|
||||
|
||||
Cylon.robot({
|
||||
connection: { name: 'loopback', adaptor: 'loopback' },
|
||||
device: { name: 'ping', driver: 'ping' },
|
||||
|
||||
commands: ['test'],
|
||||
|
||||
test: function(greeting) {
|
||||
return greeting + " world";
|
||||
},
|
||||
|
||||
work: function() {
|
||||
every(1..second(), function() { console.log("Hello, human!"); });
|
||||
after(10..seconds(), function() { console.log("Impressive."); });
|
||||
every((60).seconds(), console.log);
|
||||
}
|
||||
}).start();
|
||||
});
|
||||
|
||||
Cylon.start();
|
||||
|
|
|
@ -10,10 +10,10 @@ Cylon.robot({
|
|||
device: { name: 'led13', driver: 'led', pin: 13, connection: 'arduino' },
|
||||
|
||||
work: function(my) {
|
||||
Logger.info("Skynet is listening...");
|
||||
console.log("Skynet is listening...");
|
||||
|
||||
my.skynet.on('message', function(data) {
|
||||
Logger.info(data);
|
||||
console.log(data);
|
||||
var data = JSON.parse(data);
|
||||
if(data.message.red == 'on') {
|
||||
my.led13.turnOn()
|
||||
|
|
|
@ -30,10 +30,10 @@ Now that Cylon knows about the necessary hardware we're going to be using, we'll
|
|||
tell it what work we want to do:
|
||||
|
||||
work: function(my) {
|
||||
Logger.info("Skynet is listening...");
|
||||
console.log("Skynet is listening...");
|
||||
|
||||
my.skynet.on('message', function(data) {
|
||||
Logger.info(data);
|
||||
console.log(data);
|
||||
var data = JSON.parse(data);
|
||||
if(data.message.red == 'on') {
|
||||
my.led13.turnOn()
|
||||
|
|
Loading…
Reference in New Issue