npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

nodecopter-remote

v0.0.2

Published

build your own Arduino remote control and create commands for the Parrot AR Drone

Downloads

3

Readme

Nodecopter remote

Nodecopter remote is a little project for building your own remote control with Arduino and controlling a Parrot AR Drone.

installation

npm install nodecopter-remote

usage

You can see an example on hooking up the nodecopter-remote in example/index.js. If you want to execute the example, you need to cd into nodecopter-remote and run 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 example/index.js).

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 takeoff 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 = new Remote({
      takeoffLand: 7
    , button1: 8 // joystick button left
    , button2: 9 // joystick button right
    // pins for the joystick
    , frontBack: 'A0'
    , leftRight: 'A1'
    , upDown: 'A2'
    , turn: 'A3'
    }, [
      'flipLeft' // animation on the left joystick
    , 'flipRight' // animation on the right joystick
    ]
  );

Available animations:

// 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'
];

building the remote

You can find an image of the finished remote in example/remote.jpg.

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.

hardware components

The components you need:

  • 3x 10k resistors
  • 2x PS3 style joysticks, preferably with push-button functionality
  • 1x regular push button
  • a few cables
  • breadboard
  • Arduino Uno (others might work, but I only tested with the Uno)

License

The code is licensed under the MIT license.