UNPKG

602 BJavaScriptView Raw
1'use strict';
2
3var WiFli = require('../index')
4 , MockConnection = require('../lib/mock-connection')
5 ;
6
7var kopter = new WiFli();
8
9// replace this with a real connect() call to send to real copter
10kopter.connection = new MockConnection();
11
12kopter.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// });