This commit is contained in:
fabito 2014-06-01 11:12:02 -03:00
commit adda142d8e
1 changed files with 4 additions and 3 deletions

View File

@ -10,6 +10,7 @@ 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:
```
connections: [ connections: [
{ name: 'leapmotion', adaptor: 'leapmotion', port: '127.0.0.1:6437' }, { name: 'leapmotion', adaptor: 'leapmotion', port: '127.0.0.1:6437' },
{ name: 'ardrone', adaptor: 'ardrone', port: '192.168.1.1' }, { name: 'ardrone', adaptor: 'ardrone', port: '192.168.1.1' },
@ -21,14 +22,14 @@ Let's define the connections and devices:
{ name: 'leapmotion', driver: 'leapmotion', connection:'leapmotion' }, { name: 'leapmotion', driver: 'leapmotion', connection:'leapmotion' },
{ name: 'keyboard', driver: 'keyboard', connection:'keyboard'} { name: 'keyboard', driver: 'keyboard', connection:'keyboard'}
], ],
```
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:
work: function(my) { work: function(my) {
my.leapmotion.on('frame', function(frame) { // TODO
frame.hands.length > 0 ? my.led.turnOn() : my.led.turnOff();
});
} }
Now that our robot knows what work to do, and the work it will be doing that Now that our robot knows what work to do, and the work it will be doing that