1 | ;
|
2 |
|
3 | var WiFli = require('../index')
|
4 | , MockConnection = require('../lib/mock-connection')
|
5 | ;
|
6 |
|
7 | var kopter = new WiFli();
|
8 |
|
9 | // replace this with a real connect() call to send to real copter
|
10 | kopter.connection = new MockConnection();
|
11 |
|
12 | kopter.runQueue(function (q) {
|
13 | q.on('end', function () {
|
14 | console.log('all done!');
|
15 | kopter.end();
|
16 | });
|
17 |
|
18 | for (var i = 8; i < 40; i += 1) q.enqueue({rotorSpeed : i}, 200);
|
19 | for ( ; i >= 8; i -= 1) q.enqueue({rotorSpeed : i}, 200);
|
20 | });
|
21 |
|
22 | // uncomment and put the above in here for a real run
|
23 | // kopter.connect(function () {
|
24 | // });
|