Open combs opened 4 years ago
and here's the code, for reference:
from gpiozero import PWMLED
from aiy.pins import PIN_A, PIN_B
a = PWMLED(PIN_A, frequency=1000) #works
b = PWMLED(PIN_B, frequency=1000) #fails
b = PWMLED(PIN_B, frequency=100) #works
I think I had it open in two processes. Would still love some documentation for pwm-aiy-io module! Thanks!
@combs Would you mind sharing the results of your tests? Thanks!
@combs Would you mind sharing the results of your tests? Thanks!
I had the pin still open in another process, which kept the frequency fixed, so this was a procedural mistake on my part. It went away after a restart.
I'm curious about the max frequencies and any extra caveat :)
I was getting terrible results because it seems to reset the channel and its frequency every time the PWM value is changed, so any sort of smoothly changing value is broken up with lots of gaps. I discontinued use of the AIY PWM in my application.
The source for the PWM module is on the filesystem in the AIY Raspbian image, though not in any public source control that I could find. It should have the max frequencies in its logic.
The module is still largely undocumented. If Google used public source control for it, this might be more easily fixed.
Hello! I am learning through trial and error that the AIY Vision Bonnet's pins have different permissible values for the PWM frequency, at least as set through the Python AIY libraries.
I can set PIN_A. PIN_C, PIN_D to 1000hz PWM but PIN_B only accepts 100hz. And it seems like particular values are permissible and other values are not, e.g. 2000hz.
Is there documentation for the pwm-aiy-io module? I searched this repository and looked at Google's other AIY projects repos, and couldn't find anything.
Example of bad value's error output: