Giter Site home page Giter Site logo

daniellehuisman / node-wii Goto Github PK

View Code? Open in Web Editor NEW

This project forked from danyocom/node-wii

4.0 1.0 4.0 1.4 MB

[OUTDATED] Node.js cwiid asynchronous native bindings

License: Other

Shell 10.30% C 18.87% HTML 16.12% JavaScript 9.92% Python 0.31% C++ 44.49%

node-wii's Introduction

wii

Wii provides asynchronous native bindings to the libcwiid C API.

NOTE: This library currently only works with Node.js 0.10.x. See issue #2 for more information.

Contributors

Building and installing

Dependencies

To run wii you need Node.js (>=v0.10.0) or io.js (>=v1.0.0), bluez, and libcwiid installed. To run unit tests you will need to have git installed and accessible from your PATH to fetch any vendor/ addons.

It is sufficient enough to rely on the system package manager to install libcwiid and bluez. Refer to your distros repository search to find the correct module names and installation procedure.

Linux (Ubuntu/Debian)

Ensure you have the dependancies installed

$ sudo apt-get install libbluetooth-dev libcwiid-dev
$ sudo npm install -g node-gyp

Install wii by from npm:

$ npm install wii

A demo applicaton can be run like so:

$ node example/simple/server.js

Apple OS X/Windows via Cygwin

node-wii currently does not run on either Mac OS X or Windows machines. This is a problem with libcwiid. A future plan is to fork libcwiid and write support for at least Apple OS X.

API Example Usage

Connecting and enabling features

Raw API

var wii = require("wii");
var wiimote = new wii.WiiMote();

// You may specify a mac address to your wiimote, or use 00:00:00:00:00
wiimote.connect("00:00:00:00:00", function(err) {
  if( err ) {
    console.log( 'Could not establish connection' );
    return;
  }

  // Enable rumble
  wiimote.rumble(true);

  // Turn on led"s 1 and 3
  wiimote.led(1, true);
  wiimote.led(3, true);

  // Turn off led 3
  wiimote.led(3, false);

  // Get IR Data
  wiimote.ir(true);
  wiimote.on("ir", function(points) {
    for (var p in points)
      console.log("Point", p['x'], p['y'], p['size']);
  });
});

Methods

  • connect(address, callback)
  • disconnect()
  • requestStatus()
  • rumble(flag)
  • led(led, flag)
  • button(flag)
  • ir(flag)
  • ext(flag)
  • acc(flag)

Events

  • connect
  • disconnect
  • accelerometer
  • button
  • ir
  • status
  • nunchuk
  • classic
  • balance
  • motionplus

Release information

v0.1.0 (by DanielHuisman)

  • Cleaned up the project
  • Added nunchuk support
  • Added classic controller support
  • Added balance support
  • Added motion plus support
  • Added request status, but cwiid doesn't seem to do anything with it

v0.0.8 (by danyocom):

  • Cleaned up the readme file

v0.0.7 (by danyocom):

  • Disabled console debug output

v0.0.4 - v0.0.6 (by danyocom):

  • Renamed project to node-wii for publishing on npmjs.org
  • Fixed pacakge.json to point to the node-wii.js stub instead of erronusly trying to load the binary directly

v0.0.3 (by bramp):

  • Upgraded to support node 0.10.0
  • Change build system to node-gyp
  • Change event framework from EIO to UV

v0.0.2 (by bramp):

  • Added a new example using socket.io
  • Changed the use of cwiid to be truely async

v0.0.1:

  • Some useful methods implemented
  • Partial examples in example directory

Getting involved

If you find this project of interest, please document all issues and fork if you feel you can provide a patch.

node-wii's People

Contributors

bramp avatar tbranyen avatar daniellehuisman avatar danyocom avatar

Stargazers

Thomas avatar Andy Garbett avatar Max Nowack avatar Spencer Hill avatar

Watchers

 avatar

node-wii's Issues

Errors on building

I'm trying to use your module for my home project and I got in trouble while trying to build/install it.

make calls out errors in the source code. Specifically in wiimote.h. First error is on line 29.

I'm trying to build it in a clean environment on freshly installed Ubuntu Server.

Here's the generated npm-debug.log

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.