Skip to content
This repository was archived by the owner on May 6, 2021. It is now read-only.

miguelmota/big-red-button

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Big Red Button

A node-hid based driver to read actions from the Dream Cheeky Big Red Button.

Credit

This was initially a fork of BigRedButtonNodeHID by Dj Walker-Morgan.

Install

npm install big-red-button

Usage

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);
  });
}

Events

  • lidRaised

  • lidClosed

  • buttonPressed

  • buttonReleased

  • error

State methods

  • button.isLidUp()

  • button.isLidDown()

  • button.isButtonPressed()

FAQ

  • 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 is 13.

License

MIT

About

A node-hid based driver to read actions from the Dream Cheeky Big Red Button

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published