Skip to content

Instantly share code, notes, and snippets.

@johannilsson
Created May 14, 2014 18:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johannilsson/caba3f63d7e90af406ce to your computer and use it in GitHub Desktop.
Save johannilsson/caba3f63d7e90af406ce to your computer and use it in GitHub Desktop.
HID test
var HID = require('node-hid');
var devices = HID.devices()
console.log(devices);
// Set path here.
var path = '';
var device = new HID.HID(path);
device.on('data', function(data) {
console.log('GOT DATA: ', data);
});
device.on('error', function(err) {
console.log('GOT ERROR: ', err);
});
console.log('WRITE');
device.write([0x00, 0x01, 0x01, 0x05]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment