Control your quadrocopter with JavaScript.
- Arduino board (tested with Arduino Due) and A7105 chip
- node.js and npm
- bower (install with
npm install -g bower
) - gulp (install with
npm install -g gulp
)
- Follow the instructions to build the transmitter station with a small modification:
- instead of 3 wire SPI use 4 wire SPI:
- skip step 10 "Put an additional wire from the 'SDIO' pin of the A7105 to the 'MISO' pin of the due."
- instead wire 'gio1' of the A7105 chip to the 'MISO' port of the arduino due
- test some resistor values (as written in the tutorial) - mine didn't work with 22K Ohm, but it works with 10K Ohm
-
Clone this repository
-
Open
arduino/arduino.ino
with the arduino IDE and send it to your arduino board -
Execute
bower install
,npm install
,npm link
andnpm link coptermanager-simple
-
Run
node start-repl.js
There are 4 ways to interact with the drone:
- Issue commands in the node.js REPL: start the REPL with
node start-repl.js
and then execute commands likeclient.takeoff()
,client.throttle(30)
, ... - Control the drone with your keyboard: open the webapp at http://localhost:3000/copter/keyboard
- Upload code in the webapp: open http://localhost:3000/copter/code in your browser
- Execute autonomous scripts: see the examples directory
var coptermanager = require('coptermanager-simple');
var client = new coptermanager.Client({serialport: '/dev/tty.usbmodem1411'});
client.bind(function() {
client.takeoff()
.after(5000, function() {
this.elevator(112);
})
.after(1000, function() {
this.ledOff();
})
.after(1000, function() {
this.land();
})
.after(1000, function() {
this.disconnect();
});
});