should fix and work with #58

- add hid_test_js
This commit is contained in:
hathach
2019-05-24 12:33:56 +07:00
parent 231773cae9
commit 5f34c63660
3 changed files with 19 additions and 2 deletions

View File

@@ -0,0 +1,17 @@
var HID = require('node-hid');
var devices = HID.devices();
var deviceInfo = devices.find( function(d) {
var isNRF = d.vendorId===0Xcafe && d.productId===0X4004;
return isNRF;
});
if( deviceInfo ) {
console.log(deviceInfo)
var device = new HID.HID( deviceInfo.path );
device.on("data", function(data) {console.log(data)});
device.on("error", function(err) {console.log(err)});
setInterval(function () {
device.write([0x00, 0x01, 0x01, 0x05, 0xff, 0xff]);
},500)
}