How to use the pigpio.initialize function in pigpio

To help you get started, we’ve selected a few pigpio examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github fivdi / pi-io / lib / pi-io.js View on Github external
function PiIO() {
  LinuxIO.call(this, {
    name: 'Pi-IO',
    pins: pins,
    defaultI2cBus: 1,
    defaultLed: 'LED0'
  });

  pigpio.initialize();

  // After explicitly calling pigpio.initialize wait 100ms for pigpio to become
  // ready for usage. This delay is necessary for alerts to function correctly.
  // See https://github.com/joan2937/pigpio/issues/127
  // Update: This issue was fixed with pigpio V63 in May 2017. When Raspbian is
  // updated to include pigpio V63 the timeout here can be removed.
  setTimeout(function () {
    this.emit('connect');
    this.emit('ready');
  }.bind(this), 100);
}
util.inherits(PiIO, LinuxIO);

pigpio

Fast GPIO, PWM, servo control, state change notification, and interrupt handling on the Raspberry Pi

MIT
Latest version published 4 years ago

Package Health Score

45 / 100
Full package analysis