build your own Arduino remote control and create commands for the Parrot AR Drone
Nodecopter remote is a little project for building your own remote control with Arduino and controlling a Parrot AR Drone.
npm install nodecopter-remote
You can see an example on hooking up the nodecopter-remote in
If you want to execute the example, you need to
npm install to install the dev dependencies. Then you can execute
the example with
node example/index.js and have a working remote, given that
you are connected to the drone via WiFi and have your Arduino connected.
The remote that is exported is an event emitter.
The events emitted by the remote are:
var events ='takeoff''land''up''down''clockwise''counterClockwise''front''back''left''right''animate''animateLeds';
These events have the same name as the methods on the drone client, so binding
them 1 to 1 is easy. (See bottom of
There is one case you might want to code for: When the drone crashes or is flipped
over, it goes into emergency mode. This is either disabled my creating a new client
or by calling
client.disableEmergency() which allows you to start flying again.
You can see one way of handling it in
example/index.js, i.e. by proxying the
method and always calling
client.disableEmergency() before takeoff.
If you have used the provided diagramme, you can just use it out of the box. If not, you can override the pin map. You can also override the default animations.
An example of overriding the defaults:
var remote = fivetakeoffLand: 7button1: 8 // joystick button leftbutton2: 9 // joystick button right// pins for the joystickfrontBack: 'A0'leftRight: 'A1'upDown: 'A2'turn: 'A3''flipLeft' // animation on the left joystick'flipRight' // animation on the right joystick;
// led animations'blinkGreenRed' 'blinkGreen' 'blinkRed' 'blinkOrange' 'snakeGreenRed''fire' 'standard' 'red' 'green' 'redSnake' 'blank' 'rightMissile''leftMissile' 'doubleMissile' 'frontLeftGreenOthersRed''frontRightGreenOthersRed' 'rearRightGreenOthersRed''rearLeftGreenOthersRed' 'leftGreenRightRed' 'leftRedRightGreen''blinkStandard';// move animations'phiM30Deg' 'phi30Deg' 'thetaM30Deg' 'theta30Deg' 'theta20degYaw200deg''theta20degYawM200deg' 'turnaround' 'turnaroundGodown' 'yawShake''yawDance' 'phiDance' 'thetaDance' 'vzDance' 'wave' 'phiThetaMixed''doublePhiThetaMixed' 'flipAhead' 'flipBehind' 'flipLeft' 'flipRight';
N.B: you need to inject your copy of
johnny-five into the Remote constructor now.
Take a look at the updated example. The example will work.
You can find an image of the finished remote in
If you want to reproduce the remote exactly, I created a Fritzing diagramme that shows you how everything is wired up. Fritzing is an open-source software available on all major platforms and can be downloaded at http://fritzing.org.
The components you need:
The code is licensed under the MIT license.