A node-hid based driver to read actions from the Dream Cheeky Big Red Button.
This was initially a fork of BigRedButtonNodeHID by Dj Walker-Morgan.
npm install big-red-button
var BigRedButton = require('big-red-button');
var bigRedButtons = [];
for (var i = 0; i < BigRedButton.deviceCount(); i++) {
console.log('opening BigRedButton', i);
bigRedButtons.push(new BigRedButton.BigRedButton(i));
bigRedButtons[i].on('buttonPressed', function () {
console.log('Button pressed');
});
bigRedButtons[i].on('buttonReleased', function () {
console.log('Button released');
});
bigRedButtons[i].on('lidRaised', function () {
console.log('Lid raised');
});
bigRedButtons[i].on('lidClosed', function () {
console.log('Lid closed');
});
bigRedButtons[i].on('error', function (error) {
console.error(error);
});
}
-
lidRaised
-
lidClosed
-
buttonPressed
-
buttonReleased
-
error
-
button.isLidUp()
-
button.isLidDown()
-
button.isButtonPressed()
-
Q. It's not working on linux!
-
A. On linux, you may need to run as root for it to work. You can try setting a rule for non-root users to access the device.
Create the rule file:
sudo vim /etc/udev/rules.d/100-bigred.rules
and add the following:
SUBSYSTEM=="input", GROUP="input", MODE="0666" SUBSYSTEM=="usb", ATTRS{idVendor}=="7476", ATTRS{idProduct}=="13", MODE:="666", GROUP="plugdev"
Afterwards, you can reload the service:
sudo udevadm control --reload-rules
More info on the node-hid repo.
-
-
Q. What's the vendor ID and product ID?
- A. The vendor ID is
7476
. The product ID is13
.
- A. The vendor ID is
MIT