GitXplorerGitXplorer
m

node-dimensions

public
13 stars
3 forks
0 issues

Commits

List of commits on branch master.
Unverified
a665112245bd36d45f82dea5ac5175c9eb207b98

Merge pull request #1 from AntiCatCH/master

mmpetrov committed 9 years ago
Unverified
193a9dac594f57ace299a6cc8dd44e1120e789fb

FIX: HID device write on Windows

ddrandreas committed 9 years ago
Unverified
5dff64f906e21e3840f1ac22806cfff9d2eb4656

Moved CRC to a dedicated function

ddrandreas committed 9 years ago
Unverified
c87cf6d3e9f996316701be20f6b67f5f3d27ade9

publish npm

mmpetrov committed 9 years ago
Unverified
ff0fbbebf3293393788b238a36d9426cf9368a64

publish npm

mmpetrov committed 9 years ago
Unverified
69e1b09297ebb864aafd67ca7327684603d052a0

adding docs

mmpetrov committed 9 years ago

README

The README file for this repository.

node-dimensions

Lego Dimensions Toy Pad library for NodeJS.

Installation

  npm install node-dimensions --save

Usage

Load the module

  var dimensions = require('node-dimensions');

Connect to a device

Construct a new device and connect to it:

  device = new dimensions.Device();
  device.connect();

Optionally, listen for the device to connect:

  device.on('connected', function() {
  });

Listen for minifig scans

Listening for minifigs scans can be done by registering an handler:

  device.on('minifig-scan', function(event) {
  });

Notes:

  • The identity of a minifig can be checked via the minifig property. For example: event.minifig == dimensions.Minifig.BATMAN.
  • Events are received when a minifig is added or removed from a panel. The action event property specifies either dimensions.Minifig.ADD or dimensions.Minifig.REMOVE
  • The panel property specifies on which panel the scan occurred. This can be one of dimensions.Panel.LEFT, dimensions.Panel.RIGHT, or dimensions.Panel.CENTER.

Update panel LEDs

Panel LEDs can be updated using the following:

  device.updatePanel(panel, color, speed);

Arguments:

  • panel - The panel to be updated, can be one of dimensions.Panel.LEFT, dimensions.Panel.RIGHT, dimensions.Panel.CENTER, dimensions.Panel.ALL.
  • color - The RGB color of the panel. For example: red would be 0xFF0000 while 0x000000 would turn off the LEDs.
  • speed - An optional parameter specifying the speed with which to update the panel LEDs. 0.0 is the slowest update speed available, while 1.0 is the fastest.