0x294b (hex)
10571 (dec)
0x1908 (hex)
6408 (dec)
array(0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) (Toggle Mode - Default)
array(0x05, 0x00, 0x00, 0xFF, 0x3F, 0x00, 0x00, 0x00, 0x00) (Momentary Mode)
The main difference between a toggle mode and a momentary mode is that a toggle mode remains in the on or off position until it is manually switched to the opposite position, while a momentary mode only remains in the on position while it is being pressed or held down.
Outgoing Byte | Outgoing Bit | Bit function | Bit Value | Hex Value |
---|---|---|---|---|
1 | 1-8 | Fixed value | 8=0, 7=0, 6=0, 5=0, 4=0, 3=1, 2=0, 1=1 (00000101) | 0x05 |
2 | 1 | LED 1 State | 0 = LED light off 1 = LED light on The state set here is respected only when the corresponding LED Controller is set to 1 |
0x00 - 0xFF |
2 | LED 2 State | |||
3 | LED 3 State | |||
4 | LED 4 State | |||
5 | LED 5 State | |||
6 | LED 6 State | |||
7 | LED 7 State | |||
8 | LED 8 State | |||
3 | 1 | LED 9 State | 0 = LED light off 1 = LED light on The state set here is respected only when the corresponding LED Controller is set to 1 |
0x00 - 0x3F |
2 | LED 10 State | |||
3 | LED 11 State | |||
4 | LED 12 State | |||
5 | LED 13 State | |||
6 | LED 14 State | |||
7 | Fixed value | 0 | ||
8 | Fixed value | |||
4 | 1 | Button 1 Mode | 0 = Toggle mode 1 = Momentary mode |
0x00 - 0xFF |
2 | Button 2 Mode | |||
3 | Button 3 Mode | |||
4 | Button 4 Mode | |||
5 | Button 5 Mode | |||
6 | Button 6 Mode | |||
7 | Button 7 Mode | |||
8 | Button 8 Mode | |||
5 | 1 | Button 9 Mode | 0 = Toggle mode 1 = Momentary mode |
0x00 - 0x3F |
2 | Button 10 Mode | |||
3 | Button 11 Mode | |||
4 | Button 12 Mode | |||
5 | Button 13 Mode | |||
6 | Button 14 Mode | |||
7 | Fixed value | 0 | ||
8 | Fixed value | |||
6 | 1 | LED 1 Controller | 0 = Controlled by corresponding button mode 1 = Controlled by corresponding LED state |
0x00 - 0xFF |
2 | LED 2 Controller | |||
3 | LED 3 Controller | |||
4 | LED 4 Controller | |||
5 | LED 5 Controller | |||
6 | LED 6 Controller | |||
7 | LED 7 Controller | |||
8 | LED 8 Controller | |||
7 | 1 | LED 9 Controller | 0 = Controlled by corresponding button mode 1 = Controlled by corresponding LED state |
0x00 - 0x3F |
2 | LED 10 Controller | |||
3 | LED 11 Controller | |||
4 | LED 12 Controller | |||
5 | LED 13 Controller | |||
6 | LED 14 Controller | |||
7 | Fixed value | 0 | ||
8 | Fixed value | |||
8 | 1-8 | Fixed value | 00000000 | 0x00 |
9 | 1-8 | Fixed value | 00000000 | 0x00 |
const HID = require("node-hid"); // NPM module
let gear = new HID.HID(10571, 6408); //Connect to HID device with vendor and product ID
// This setup sets Button 1-3 & 7-9 to momentary mode and button 13 & 14 to have the LEDs always on
let byte2led1to8 = 00000000; // <- LED 1-8 off
let byte3led9to14 = 00001100; // <- LED 9-12 off & LED 13-14 on
let byte4btn1to8 = 11100011; // <- Button 1-3, 7-8 on & Button 4-6 off
let byte5btn9to14 = 10000000; // <- Button 9 on & Button 10-14 off
let byte6ledMode1to8 = byte2led1to8; // When you set an LED Light you have to set the
let byte7ledMode9to14 = byte3led9to14; // corresponding LED controller to the same value
gear.write([ // write to the gear
0x05, // <- fixed value
toHex(byte2led1to8),
toHex(byte3led9to14),
toHex(byte4btn1to8),
toHex(byte5btn9to14),
toHex(byte6ledMode1to8),
toHex(byte7ledMode9to14),
0x00, // <- fixed value
0x00 // <- fixed value
]);
gear.close(); // close connection to reconnect if needed
function toHex(value) {
return Number("0x" + parseInt(value, 2).toString(16)); // Converts the binary to hex in right format
}