Update examples for new syntax

This commit is contained in:
Andrew Stewart 2014-11-25 16:01:31 -08:00
parent 9047797c9f
commit 7d4aa1ffee
32 changed files with 281 additions and 137 deletions

View File

@ -16,8 +16,13 @@ Object.keys(bots).forEach(function(name) {
Cylon.robot({ Cylon.robot({
name: name, name: name,
connection: { name: 'sphero', adaptor: 'sphero', port: port }, connections: {
device: { name: 'sphero', driver: 'sphero' }, sphero: { adaptor: 'sphero', port: port }
},
devices: {
sphero: { driver: 'sphero' }
},
work: function(my) { work: function(my) {
every((1).seconds(), function() { every((1).seconds(), function() {

View File

@ -39,12 +39,16 @@ Now we can define the basic robot both of our Sphero robots will be based on.
Both robots will be connecting to Spheros, and so using the cylon-sphero Both robots will be connecting to Spheros, and so using the cylon-sphero
adaptor: adaptor:
connection: { name: 'sphero', adaptor: 'sphero', port: port }, connections: {
sphero: { adaptor: 'sphero', port: port }
},
And both will be connecting to the same kind of device (you guessed it, And both will be connecting to the same kind of device (you guessed it,
a Sphero). a Sphero).
device: { name: 'sphero', driver: 'sphero' }, devices: {
sphero: { driver: 'sphero' }
},
Both robots will be performing the same kind of work as well. Every second, Both robots will be performing the same kind of work as well. Every second,
they'll print their name to the console, set themselves to a random color, and they'll print their name to the console, set themselves to a random color, and

View File

@ -21,7 +21,9 @@ bots.forEach(function(bot) {
skynet: { adaptor: "skynet", uuid: bot.uuid, token: bot.port } skynet: { adaptor: "skynet", uuid: bot.uuid, token: bot.port }
}, },
device: { name: "led13", driver: "led", pin: 13, connection: "arduino" }, devices: {
led13: { driver: "led", pin: 13, connection: "arduino" }
},
work: function(my) { work: function(my) {
my.skynet.on('message', function(data) { my.skynet.on('message', function(data) {

View File

@ -23,11 +23,12 @@ var arduinos = [
Cylon.robot({ Cylon.robot({
name: "SkynetBot", name: "SkynetBot",
connection: { connections: {
name: 'skynet', skynet: {
adaptor: 'skynet', adaptor: 'skynet',
uuid: "96630051-a3dc-11e3-8442-5bf31d98c912", uuid: "96630051-a3dc-11e3-8442-5bf31d98c912",
token: "2s67o7ek98pycik98f43reqr90t6s9k9" token: "2s67o7ek98pycik98f43reqr90t6s9k9"
}
}, },
handler: function(data) { handler: function(data) {
@ -59,7 +60,10 @@ arduinos.forEach(function(bot) {
Cylon.robot({ Cylon.robot({
name: bot.name, name: bot.name,
connection: { name: 'arduino', adaptor: 'firmata', port: bot.port }, connections: {
arduino: { adaptor: 'firmata', port: bot.port }
},
devices: bot.devices, devices: bot.devices,
work: function(my) { work: function(my) {

View File

@ -16,8 +16,13 @@ Object.keys(bots).forEach(function(name) {
Cylon.robot({ Cylon.robot({
name: name, name: name,
connection: { name: 'sphero', adaptor: 'sphero', port: port }, connections: {
device: { name: 'sphero', driver: 'sphero' }, sphero: { adaptor: 'sphero', port: port }
},
devices: {
sphero: { driver: 'sphero' }
},
work: function(my) { work: function(my) {
my.born(); my.born();

View File

@ -59,8 +59,13 @@ device (you guessed it, a Sphero).
Cylon.robot({ Cylon.robot({
name: name, name: name,
connection: { name: 'sphero', adaptor: 'sphero', port: port }, connections: {
device: { name: 'sphero', driver: 'sphero' }, sphero: { adaptor: 'sphero', port: port }
},
devices: {
sphero: { driver: 'sphero' }
},
Now that the pieces are there, we can set up our robot's work. It starts by Now that the pieces are there, we can set up our robot's work. It starts by
being "born", then moves every three seconds if it's alive, celebrates it's being "born", then moves every three seconds if it's alive, celebrates it's

View File

@ -15,8 +15,8 @@ Object.keys(bots).forEach(function(name) {
var robot = Cylon.robot({ name: name, }); var robot = Cylon.robot({ name: name, });
robot.connection({ name: 'sphero', adaptor: 'sphero', port: port }); robot.connection('sphero', { adaptor: 'sphero', port: port });
robot.device({ name: 'sphero', driver: 'sphero' }); robot.device('sphero', { driver: 'sphero' });
robot.move = function() { robot.move = function() {
robot.sphero.roll(60, Math.floor(Math.random() * 360)); robot.sphero.roll(60, Math.floor(Math.random() * 360));

View File

@ -1,8 +1,13 @@
var Cylon = require('../..'); var Cylon = require('../..');
Cylon.robot({ Cylon.robot({
connection: { name: 'crazyflie', adaptor: 'crazyflie', port: "radio://1/10/250KPS" }, connections: {
device: { name: 'drone', driver: 'crazyflie' }, crazyflie: { adaptor: 'crazyflie', port: "radio://1/10/250KPS" }
},
devices: {
drone: { driver: 'crazyflie' }
}
work: function(my) { work: function(my) {
my.drone.on('start', function() { my.drone.on('start', function() {

View File

@ -15,13 +15,13 @@ Now that we've got that set up, we can start defining our robot:
We'll be using one connection and one device for this robot, both using the We'll be using one connection and one device for this robot, both using the
crazyflie adaptor. We'll be connecting to the Crazyflie using the CrazyRadio. crazyflie adaptor. We'll be connecting to the Crazyflie using the CrazyRadio.
connection: { connections: {
name: 'crazyflie', crazyflie: { adaptor: 'crazyflie', port: "radio://1/10/250KPS" }
adaptor: 'crazyflie',
port: "radio://1/10/250KPS"
}, },
device: { name: 'drone', driver: 'crazyflie' } devices: {
drone: { driver: 'crazyflie' }
}
With the parts in place, we can start defining our robot's work. With the parts in place, we can start defining our robot's work.

View File

@ -1,8 +1,13 @@
var Cylon = require('../..'); var Cylon = require('../..');
Cylon.robot({ Cylon.robot({
connection: { name: 'digispark', adaptor: 'digispark' }, connections: {
device: { name: 'led', driver: 'led', pin: 1 }, digispark: { adaptor: 'digispark' }
},
devices: {
led: { driver: 'led', pin: 1 }
},
work: function(my) { work: function(my) {
every((1).second(), my.led.toggle); every((1).second(), my.led.toggle);

View File

@ -10,8 +10,13 @@ Now that we have Cylon imported, we can start defining our robot
Let's define the connections and devices: Let's define the connections and devices:
connection: { name: 'digispark', adaptor: 'digispark' }, connections: {
device: { name: 'led', driver: 'led', pin: 1 }, digispark: { adaptor: 'digispark' }
},
devices: {
led: { driver: 'led', pin: 1 }
},
Now that Cylon knows about the necessary hardware we're going to be using, we'll Now that Cylon knows about the necessary hardware we're going to be using, we'll
tell it what work we want to do: tell it what work we want to do:

View File

@ -1,8 +1,13 @@
var Cylon = require('../..'); var Cylon = require('../..');
Cylon.robot({ Cylon.robot({
connection: { name: 'loopback', adaptor: 'loopback' }, connections: {
device: { name: 'ping', driver: 'ping' }, loopback: { adaptor: 'loopback' }
},
devices: {
ping: { driver: 'ping' }
},
work: function(my) { work: function(my) {
after((1).second(), function() { after((1).second(), function() {

View File

@ -0,0 +1,20 @@
var Cylon = require('../..');
Cylon.api();
Cylon
.robot({ name: 'test' })
.connection('loopback', { adaptor: 'loopback' })
.device('ping', { driver: 'ping' })
.on('ready', function(bot) {
setInterval(function() {
console.log("Hello, human!")
console.log(bot.ping.ping());
}, 1000);
setTimeout(function() {
console.log("I've been at your command for 5 seconds now.")
}, 5000);
});
Cylon.start();

View File

@ -5,8 +5,13 @@ Cylon.api();
Cylon.robot({ Cylon.robot({
name: 'test', name: 'test',
connection: { name: 'loopback', adaptor: 'loopback' }, connections: {
device: { name: 'ping', driver: 'ping' }, loopback: { adaptor: 'loopback' }
},
devices: {
ping: { driver: 'ping' }
},
work: function(my) { work: function(my) {
every((1).seconds(), function(){ every((1).seconds(), function(){

View File

@ -13,8 +13,13 @@ Now we can define our robot:
Cylon.robot({ Cylon.robot({
name: 'test', name: 'test',
connection: { name: 'loopback', adaptor: 'loopback' }, connections: {
device: { name: 'ping', driver: 'ping' }, loopback: { adaptor: 'loopback' }
},
devices: {
ping: { driver: 'ping' }
},
For work, it's going to print a message to the console every second, and another For work, it's going to print a message to the console every second, and another
message after five seconds have elapsed. message after five seconds have elapsed.

View File

@ -1,15 +0,0 @@
var Cylon = require('cylon');
var robot = new Cylon.Robot({
connection: { name: 'loopback', adaptor: 'loopback' },
device: { name: 'ping', driver: 'ping' },
});
setInterval(function() {
console.log("Hello, human!")
console.log(robot.ping.ping());
}, 1000);
setTimeout(function() {
console.log("I've been at your command for 5 seconds now.")
}, 5000);

View File

@ -1,8 +1,13 @@
var Cylon = require('../..'); var Cylon = require('../..');
Cylon.robot({ Cylon.robot({
connection: { name: 'keyboard', adaptor: 'keyboard' }, connections: {
device: { name: 'keyboard', driver: 'keyboard' }, keyboard: { adaptor: 'keyboard' }
},
devices: {
keyboard: { driver: 'keyboard' }
},
work: function(my) { work: function(my) {
my.keyboard.on('a', function(key) { my.keyboard.on('a', function(key) {

View File

@ -13,8 +13,13 @@ With that done, let's define our robot:
It will have a single connection and device, both to the keyboard. It will have a single connection and device, both to the keyboard.
connection: { name: 'keyboard', adaptor: 'keyboard' }, connections: {
device: { name: 'keyboard', driver: 'keyboard' }, keyboard: { adaptor: 'keyboard' }
},
devices: {
keyboard: { driver: 'keyboard' }
},
When we tell this robot to work, it's going to listen to the 'a' key on the When we tell this robot to work, it's going to listen to the 'a' key on the
keyboard and let us know when it's been pressed. keyboard and let us know when it's been pressed.

View File

@ -6,7 +6,9 @@ Cylon.robot({
arduino: { adaptor: 'firmata', port: '/dev/ttyACM0' } arduino: { adaptor: 'firmata', port: '/dev/ttyACM0' }
}, },
devices: { name: 'led', driver: 'led', pin: 13, connection: 'arduino' }, devices: {
led: { driver: 'led', pin: 13, connection: 'arduino' }
},
work: function(my) { work: function(my) {
my.leapmotion.on('frame', function(frame) { my.leapmotion.on('frame', function(frame) {

View File

@ -15,7 +15,9 @@ Let's define the connections and devices:
arduino: { adaptor: 'firmata', port: '/dev/ttyACM0' } arduino: { adaptor: 'firmata', port: '/dev/ttyACM0' }
}, },
device: { name: 'led', driver: 'led', pin: 13, connection: 'arduino' }, devices: {
led: { driver: 'led', pin: 13, connection: 'arduino' }
},
Now that Cylon knows about the necessary hardware we're going to be using, we'll Now that Cylon knows about the necessary hardware we're going to be using, we'll
tell it what work we want to do: tell it what work we want to do:

View File

@ -1,7 +1,10 @@
var Cylon = require('../..'); var Cylon = require('../..');
Cylon.robot({ Cylon.robot({
connection: { name: 'arduino', adaptor: 'firmata', port: '/dev/ttyUSB0' }, connections: {
arduino: { adaptor: 'firmata', port: '/dev/ttyUSB0' }
},
devices: { devices: {
led: { driver: 'led', pin: 17 }, led: { driver: 'led', pin: 17 },
servo: { driver: 'servo', pin: 2, range: { min: 30, max: 150 } } servo: { driver: 'servo', pin: 2, range: { min: 30, max: 150 } }

View File

@ -1,19 +1,22 @@
var Cylon = require('../..'); var Cylon = require('../..');
Cylon.robot({ Cylon.robot({
connection: { connections: {
name: 'sfcon', sfcon: {
adaptor: 'force', adaptor: 'force',
sfuser: process.env.SF_USERNAME, sfuser: process.env.SF_USERNAME,
sfpass: process.env.SF_SECURITY_TOKEN, sfpass: process.env.SF_SECURITY_TOKEN,
orgCreds: { orgCreds: {
clientId: process.env.SF_CLIENT_ID, clientId: process.env.SF_CLIENT_ID,
clientSecret: process.env.SF_CLIENT_SECRET, clientSecret: process.env.SF_CLIENT_SECRET,
redirectUri: 'http://localhost:3000/oauth/_callback' redirectUri: 'http://localhost:3000/oauth/_callback'
}
} }
}, },
device: { name: 'salesforce', driver: 'force' }, devices: {
salesforce: { driver: 'force' }
},
work: function(my) { work: function(my) {
my.salesforce.on('start', function() { my.salesforce.on('start', function() {

View File

@ -10,19 +10,22 @@ Now that we have Cylon imported, we can start defining our robot
Let's define the connections and devices: Let's define the connections and devices:
connection: { connections: {
name: 'sfcon', sfcon: {
adaptor: 'force', adaptor: 'force',
sfuser: process.env.SF_USERNAME, sfuser: process.env.SF_USERNAME,
sfpass: process.env.SF_SECURITY_TOKEN, sfpass: process.env.SF_SECURITY_TOKEN,
orgCreds: { orgCreds: {
clientId: process.env.SF_CLIENT_ID, clientId: process.env.SF_CLIENT_ID,
clientSecret: process.env.SF_CLIENT_SECRET, clientSecret: process.env.SF_CLIENT_SECRET,
redirectUri: 'http://localhost:3000/oauth/_callback' redirectUri: 'http://localhost:3000/oauth/_callback'
}
} }
}, },
device: { name: 'salesforce', driver: 'force' }, devices: {
salesforce: { driver: 'force' }
},
Now that Cylon knows about the necessary hardware we're going to be using, we'll Now that Cylon knows about the necessary hardware we're going to be using, we'll
tell it what work we want to do: tell it what work we want to do:

View File

@ -3,19 +3,22 @@ var Cylon = require('../..');
Cylon.robot({ Cylon.robot({
name: 'salesforce', name: 'salesforce',
connection: { connections: {
name: 'sfcon', sfcon: {
adaptor: 'force', adaptor: 'force',
sfuser: process.env.SF_USERNAME, sfuser: process.env.SF_USERNAME,
sfpass: process.env.SF_SECURITY_TOKEN, sfpass: process.env.SF_SECURITY_TOKEN,
orgCreds: { orgCreds: {
clientId: process.env.SF_CLIENT_ID, clientId: process.env.SF_CLIENT_ID,
clientSecret: process.env.SF_CLIENT_SECRET, clientSecret: process.env.SF_CLIENT_SECRET,
redirectUri: 'http://localhost:3000/oauth/_callback' redirectUri: 'http://localhost:3000/oauth/_callback'
}
} }
}, },
device: { name: 'salesforce', driver: 'force' }, devices: {
salesforce: { driver: 'force' }
},
work: function(my) { work: function(my) {
my.salesforce.on('start', function() { my.salesforce.on('start', function() {
@ -35,8 +38,14 @@ Cylon.robot({
Cylon.robot({ Cylon.robot({
name: 'ROY', name: 'ROY',
connection: { name: 'sphero', adaptor: 'sphero' },
device: { name: 'sphero', driver: 'sphero' }, connections: {
sphero: { adaptor: 'sphero' }
},
devices: {
sphero: { driver: 'sphero' }
},
react: function() { react: function() {
this.sphero.setRGB(0x00FF00); this.sphero.setRGB(0x00FF00);

View File

@ -9,19 +9,22 @@ With that done, let's define the Robot we'll use to communicate with Salesforce:
Cylon.robot({ Cylon.robot({
name: 'salesforce', name: 'salesforce',
connection: { connections: {
name: 'sfcon', sfcon: {
adaptor: 'force', adaptor: 'force',
sfuser: process.env.SF_USERNAME, sfuser: process.env.SF_USERNAME,
sfpass: process.env.SF_SECURITY_TOKEN, sfpass: process.env.SF_SECURITY_TOKEN,
orgCreds: { orgCreds: {
clientId: process.env.SF_CLIENT_ID, clientId: process.env.SF_CLIENT_ID,
clientSecret: process.env.SF_CLIENT_SECRET, clientSecret: process.env.SF_CLIENT_SECRET,
redirectUri: 'http://localhost:3000/oauth/_callback' redirectUri: 'http://localhost:3000/oauth/_callback'
}
} }
}, },
device: { name: 'salesforce', driver: 'force' }, devices: {
salesforce: { driver: 'force' }
},
work: function(my) { work: function(my) {
my.salesforce.on('start', function() { my.salesforce.on('start', function() {
@ -43,8 +46,14 @@ Next up, the shape our Sphero Robot will take:
Cylon.robot({ Cylon.robot({
name: 'ROY', name: 'ROY',
connection: { name: 'sphero', adaptor: 'sphero' },
device: { name: 'sphero', driver: 'sphero' }, connections: {
sphero: { adaptor: 'sphero' }
},
devices: {
sphero: { driver: 'sphero' }
},
react: function() { react: function() {
this.sphero.setRGB(0x00FF00); this.sphero.setRGB(0x00FF00);

View File

@ -11,7 +11,9 @@ Cylon.robot({
} }
}, },
device: { name: 'led13', driver: 'led', pin: 13, connection: 'arduino' }, devices: {
led13: { driver: 'led', pin: 13, connection: 'arduino' }
},
work: function(my) { work: function(my) {
console.log("Skynet is listening"); console.log("Skynet is listening");

View File

@ -20,7 +20,9 @@ Let's define the connections and devices:
} }
}, },
device: { name: 'led13', driver: 'led', pin: 13, connection: 'arduino' }, devices: {
led13: { driver: 'led', pin: 13, connection: 'arduino' }
},
Now that Cylon knows about the necessary hardware we're going to be using, we'll Now that Cylon knows about the necessary hardware we're going to be using, we'll
tell it what work we want to do: tell it what work we want to do:

View File

@ -5,8 +5,13 @@ Cylon.api({ host: '0.0.0.0', port: '8080' });
Cylon.robot({ Cylon.robot({
name: 'pebble', name: 'pebble',
connection: { name: 'pebble', adaptor: 'pebble' }, connections: {
device: { name: 'pebble', driver: 'pebble' }, pebble: { adaptor: 'pebble' }
},
devices: {
pebble: { driver: 'pebble' }
},
message: function(msg) { message: function(msg) {
this.message_queue().push(msg); this.message_queue().push(msg);
@ -20,19 +25,22 @@ Cylon.robot({
Cylon.robot({ Cylon.robot({
name: 'salesforce', name: 'salesforce',
connection: { connections: {
name: 'sfcon', sfcon: {
adaptor: 'force', adaptor: 'force',
sfuser: process.env.SF_USERNAME, sfuser: process.env.SF_USERNAME,
sfpass: process.env.SF_SECURITY_TOKEN, sfpass: process.env.SF_SECURITY_TOKEN,
orgCreds: { orgCreds: {
clientId: process.env.SF_CLIENT_ID, clientId: process.env.SF_CLIENT_ID,
clientSecret: process.env.SF_CLIENT_SECRET, clientSecret: process.env.SF_CLIENT_SECRET,
redirectUri: 'http://localhost:3000/oauth/_callback' redirectUri: 'http://localhost:3000/oauth/_callback'
}
} }
}, },
device: { name: 'salesforce', driver: 'force' }, devices: {
salesforce: { driver: 'force' }
},
spheroReport: {}, spheroReport: {},
@ -76,8 +84,13 @@ bots.forEach(function(bot) {
Cylon.robot({ Cylon.robot({
name: bot.name, name: bot.name,
connection: { name: 'sphero', adaptor: 'sphero', port: bot.port }, connections: {
device: { name: 'sphero', driver: 'sphero' }, sphero: { adaptor: 'sphero', port: bot.port }
},
devices: {
sphero: { driver: 'sphero' }
},
totalBucks: 1, totalBucks: 1,
payingPower: true, payingPower: true,

View File

@ -9,7 +9,6 @@ Next up, we'll configure the API Cylon will serve, telling it to serve on port
Cylon.api({ host: '0.0.0.0', port: '8080' }); Cylon.api({ host: '0.0.0.0', port: '8080' });
Now that we have Cylon imported, we can start defining our Pebble robot: Now that we have Cylon imported, we can start defining our Pebble robot:
Cylon.robot({ Cylon.robot({
@ -17,8 +16,13 @@ Now that we have Cylon imported, we can start defining our Pebble robot:
Let's define the connections and devices: Let's define the connections and devices:
connection: { name: 'pebble', adaptor: 'pebble' }, connections: {
device: { name: 'pebble', driver: 'pebble' }, pebble: { adaptor: 'pebble' }
},
devices: {
pebble: { driver: 'pebble' }
},
Now that Cylon knows about the necessary hardware we're going to be using, we'll Now that Cylon knows about the necessary hardware we're going to be using, we'll
tell it what work we want to do: tell it what work we want to do:
@ -39,19 +43,22 @@ Next, let's define our SalesForce robot:
Let's define the connections and devices: Let's define the connections and devices:
connection: { connections: {
name: 'sfcon', sfcon: {
adaptor: 'force', adaptor: 'force',
sfuser: process.env.SF_USERNAME, sfuser: process.env.SF_USERNAME,
sfpass: process.env.SF_SECURITY_TOKEN, sfpass: process.env.SF_SECURITY_TOKEN,
orgCreds: { orgCreds: {
clientId: process.env.SF_CLIENT_ID, clientId: process.env.SF_CLIENT_ID,
clientSecret: process.env.SF_CLIENT_SECRET, clientSecret: process.env.SF_CLIENT_SECRET,
redirectUri: 'http://localhost:3000/oauth/_callback' redirectUri: 'http://localhost:3000/oauth/_callback'
}
} }
}, },
device: { name: 'salesforce', driver: 'force' }, devices: {
salesforce: { driver: 'force' }
},
Tell it what work we want to do: Tell it what work we want to do:
@ -99,8 +106,13 @@ Now, Let's define our Sphero robots:
Cylon.robot({ Cylon.robot({
name: bot.name, name: bot.name,
connection: { name: 'sphero', adaptor: 'sphero', port: bot.port }, connections: {
device: { name: 'sphero', driver: 'sphero' }, sphero: { adaptor: 'sphero', port: bot.port }
},
devices: {
sphero: { driver: 'sphero' }
},
totalBucks: 1, totalBucks: 1,
payingPower: true, payingPower: true,

View File

@ -1,8 +1,13 @@
var Cylon = require('cylon'); var Cylon = require('cylon');
Cylon.robot({ Cylon.robot({
connection: { name: 'sphero', adaptor: 'sphero', port: '/dev/tty.Sphero-YBW-RN-SPP' }, connections: {
device: { name: 'sphero', driver: 'sphero' }, sphero: { adaptor: 'sphero', port: '/dev/tty.Sphero-YBW-RN-SPP' }
},
devices: {
sphero: { driver: 'sphero' }
},
work: function(my) { work: function(my) {
var max = 0; var max = 0;

View File

@ -4,8 +4,13 @@ var Cylon = require('../..'),
var travis = new Travis({version: '2.0.0'}); var travis = new Travis({version: '2.0.0'});
Cylon.robot({ Cylon.robot({
connection: { name: 'sphero', adaptor: 'sphero', port: '/dev/rfcomm0' }, connections: {
device: {name: 'sphero', driver: 'sphero' }, sphero: { adaptor: 'sphero', port: '/dev/rfcomm0' }
},
devices: {
sphero: { driver: 'sphero' }
},
work: function(my) { work: function(my) {
var user = "hybridgroup", var user = "hybridgroup",

View File

@ -41,13 +41,17 @@ We use a connection to tell Cylon what port it can use to communicate with our
Sphero, along with what adaptor it should require (`cylon-sphero`) to connect to Sphero, along with what adaptor it should require (`cylon-sphero`) to connect to
it. We give it a name to make it easier to reference later on. it. We give it a name to make it easier to reference later on.
connection: { name: 'sphero', adaptor: 'sphero', port: '/dev/rfcomm0' }, connections: {
sphero: { adaptor: 'sphero', port: '/dev/rfcomm0' ;n
},
Devices are set up in a similar fashion, but allow us to directly issue commands Devices are set up in a similar fashion, but allow us to directly issue commands
to the sphero. These are added to the robot's namespace directly to make them to the sphero. These are added to the robot's namespace directly to make them
easy to access. easy to access.
device: {name: 'sphero', driver: 'sphero' }, devices: {
sphero: { driver: 'sphero' }
},
Now that we've told our robot what hardware it has access to, we can start Now that we've told our robot what hardware it has access to, we can start
telling it what it should do. The work function passes along one argument, telling it what it should do. The work function passes along one argument,