Hello,
I have a Teensy 4.0 connected to my Linux box running PopOS.
First I programmed the Teensy to continuously write to the USB port, and I can read this fine using the following code:
var HID = require('node-hid');
var devices = HID.devices();
var device = new HID.HID('/dev/hidraw5');
device.on("data", function(data) {
console.log(data.toString())
});
But then I try writing to the Teensy using the following code and I can't get it to work:
var HID = require('node-hid');
var devices = HID.devices();
var device = new HID.HID('/dev/hidraw5');
setInterval(() => {
device.write([0x00, 0x01, 0x01, 0x05, 0xff, 0xff]);
console.log("Every second");
}, 1000);
The problem doesn't appear to be my code on the Teensy, because I can write to it fine using either the serial monitor in the Arduino application, or another serial monitor. I just can't write to the Teensy using node-hid.
Any suggestions?
Thanks
Reactions are currently unavailable
Hello,
I have a Teensy 4.0 connected to my Linux box running PopOS.
First I programmed the Teensy to continuously write to the USB port, and I can read this fine using the following code:
var HID = require('node-hid'); var devices = HID.devices(); var device = new HID.HID('/dev/hidraw5'); device.on("data", function(data) { console.log(data.toString()) });But then I try writing to the Teensy using the following code and I can't get it to work:
var HID = require('node-hid'); var devices = HID.devices(); var device = new HID.HID('/dev/hidraw5'); setInterval(() => { device.write([0x00, 0x01, 0x01, 0x05, 0xff, 0xff]); console.log("Every second"); }, 1000);The problem doesn't appear to be my code on the Teensy, because I can write to it fine using either the serial monitor in the Arduino application, or another serial monitor. I just can't write to the Teensy using node-hid.
Any suggestions?
Thanks