Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase PWM frequency for PCA9685 #965

Merged
merged 1 commit into from
Dec 15, 2015
Merged

Conversation

blaines
Copy link
Contributor

@blaines blaines commented Nov 15, 2015

This will reduce visible PWM flashing with the PCA9685. Mostly noticeable when recording video but also visible with the eye under certain circumstances.

This will reduce visible PWM flashing with the PCA9685. Mostly noticeable when recording video but also visible with the eye under certain circumstances.
@blaines
Copy link
Contributor Author

blaines commented Nov 15, 2015

It'd be nice to have this as an option for five.Led. Willing to implement this with some guidance.

@@ -21,7 +21,7 @@ var Controllers = {
controller: this.controller,
bus: this.bus,
pwmRange: this.pwmRange,
frequency: 50, // Hz
frequency: 100, // Hz
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should actually be 200Hz, can you try that and confirm?

@rwaldron
Copy link
Owner

It'd be nice to have this as an option for five.Led. Willing to implement this with some guidance.

Just change

-          frequency: 50, // Hz
+          frequency: this.frequency || 200, // Hz

And then this should work:

new five.Led({ 
  controller: "PCA9685", 
  pin: 0, 
  frequency: ..., 
  // and so on
});

If that doesn't work, then you might need to add:

this.frequency = opts.frequency;

Here: https://github.com/rwaldron/johnny-five/blob/master/lib/led/led.js#L17

@rwaldron
Copy link
Owner

rwaldron added a commit that referenced this pull request Dec 15, 2015
Increase PWM frequency for PCA9685
@rwaldron rwaldron merged commit 29506b5 into rwaldron:master Dec 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants