diff --git a/examples/multi_platform/multi_arduinos_with_one_skynet_connection_each.js b/examples/multi_platform/multi_arduinos_with_one_skynet_connection_each.js index baba8c9..0298348 100644 --- a/examples/multi_platform/multi_arduinos_with_one_skynet_connection_each.js +++ b/examples/multi_platform/multi_arduinos_with_one_skynet_connection_each.js @@ -57,5 +57,3 @@ Cylon.robot(skynetBot0); Cylon.robot(skynetBot1); Cylon.start(); - - diff --git a/examples/multiple_arduinos.js b/examples/multiple_arduinos.js deleted file mode 100644 index 48c4d2f..0000000 --- a/examples/multiple_arduinos.js +++ /dev/null @@ -1,64 +0,0 @@ -var Cylon = require('..'), - arduino1, arduino2; - -Arduino = (function(){ - function Arduino(){} - - Arduino.prototype.connection = { name: 'arduino', adaptor: 'firmata', port: '/dev/ttyACM0' }; - - Arduino.prototype.work = function(my) { - console.log("Name =====>"); - console.log(my.name); - } - - return Arduino; -})(); - -skynet = { - connections: [ - { name: 'skynet', - adaptor: 'skynet', - uuid: "e8f942f1-a49c-11e3-9270-795e22e700d8", token: "0lpxpyafz7z7u8frgvp44g8mbr7o80k9" } - ], - - work: function(my) { - Logger.info("Skynet is listening..."); - - my.skynet.on('message', function(data) { - console.log(data); - if (data.payload != null){ - var robot, - robots = data.payload.robots; - for(var index in robots){ - robot = robots[index]; - console.log(robot); - my.master.findRobot(robot.name, function(err, bot){ - if (robot.cmd == 'on') - bot.devices[robot.device].turnOn(); - else - bot.devices[robot.device].turnOff(); - }); - } - } - }); - } -} -Cylon.robot(skynet); - -arduino0 = new Arduino(); -console.log(arduino0); -arduino0.name = 'arduino0'; -arduino0.device = {name: 'led00', driver: 'led', pin: 13}; -Cylon.robot(arduino0); - -arduino1 = new Arduino(); -arduino1.name = 'arduino1' -arduino1.connection.port = '/dev/ttyACM1'; -arduino1.devices = [ - {name: 'led10', driver: 'led', pin: 11}, - {name: 'led11', driver: 'led', pin: 12}, - {name: 'led12', driver: 'led', pin: 13} -]; -Cylon.robot(arduino1); - -Cylon.start();