How to use the pigpio.configureClock 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 bang-olufsen / create / Beocreate2 / beo-extensions-experimental / led / index.js View on Github external
function initialise(red, green, blue) {
		if (red && green && blue) {
			pigpio.configureClock(10, pigpio.CLOCK_PWM); // Configures PiGPIO to use PWM as clock source (by default it uses PCM which conflicts with BeoCreate 4-Channel Amplifier).
			pigpio.initialize(); // pigpio C library initialized here
			
			ledR = new pigpio.Gpio(red, {mode: pigpio.Gpio.OUTPUT});
			ledG = new pigpio.Gpio(green, {mode: pigpio.Gpio.OUTPUT});
			ledB = new pigpio.Gpio(blue, {mode: pigpio.Gpio.OUTPUT});
			ledInitialised = true;
			beoBus.emit("general", {header: "requestShutdownTime", content: {extension: "led"}});
			return true;
		} else {
			return false;
		}
	}
github andrewn / neue-radio / services / physical / lib / physical.js View on Github external
module.exports.create = function(ws, uiConfig) {
  // Tells the underlying gpio library to use the
  // PWM pin as a clock source, rather than the PCM
  // pin that provides I2S audio to DACs
  pigpio.configureClock(5 /* pigpio's default duty cycle */, pigpio.CLOCK_PWM);

  const io = new IO({
    enableSoftPwm: true,
    // Only enable pins used in the config
    // to avoid clashing with other components
    includePins: collectPinNumbers(uiConfig)
  });

  var board = new five.Board({
    io: io,
    repl: false
  });

  var types = Object.keys(factories);

  var instances = {};
github bang-olufsen / create / beocreate_essentials / led.js View on Github external
function initialise(red, green, blue) {
	if (red, green, blue) {
		pigpio.configureClock(10, pigpio.CLOCK_PWM); // Configures PiGPIO to use PWM as clock source (by default it uses PCM which conflicts with BeoCreate 4-Channel Amplifier).
		ledR = new pigpio.Gpio(red, {mode: pigpio.Gpio.OUTPUT});
		ledG = new pigpio.Gpio(green, {mode: pigpio.Gpio.OUTPUT});
		ledB = new pigpio.Gpio(blue, {mode: pigpio.Gpio.OUTPUT});
		ledInitialised = true;
		return true;
	} else {
		return false;
	}
}

pigpio

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

MIT
Latest version published 3 years ago

Package Health Score

45 / 100
Full package analysis