Merge branch 'master' into remove-node-namespace

* master:
  Remove Logger usage from examples
This commit is contained in:
Andrew Stewart 2014-05-13 19:07:45 -07:00
commit 90e6ab5564
5 changed files with 19 additions and 9 deletions

View File

@ -38,7 +38,7 @@ SkynetBot = (function(){
}
});
Logger.info("Skynet instance `" + my.name + "` is listening ...");
console.log("Skynet instance `" + my.name + "` is listening ...");
};
return SkynetBot;

View File

@ -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);

View File

@ -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();

View File

@ -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()

View File

@ -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()