1 | 'use strict';
|
2 |
|
3 | var Queue = require('../lib/queue')
|
4 | , EventEmitter = require('events').EventEmitter
|
5 | , WiFli = require('../index')
|
6 | , MockConnection = require('../lib/mock-connection')
|
7 | ;
|
8 |
|
9 | var kopter = new WiFli();
|
10 |
|
11 |
|
12 | kopter.connection = new MockConnection();
|
13 |
|
14 | var q = new Queue(kopter);
|
15 | q.on('end', function () { console.log('all done!'); });
|
16 | q.enqueue({rotorSpeed : 10}, 500);
|
17 | q.enqueue({rotorSpeed : 10, pitch : -3}, 500);
|
18 | q.enqueue({rotorSpeed : 10}, 500);
|
19 | q.enqueue({rotorSpeed : 10, pitch : 4}, 500);
|
20 | q.enqueue({}, 500);
|
21 | q.end();
|
22 |
|
23 |
|
24 |
|
25 |
|