Open tyeth opened 3 months ago
output of small test case:
strangely my other longer code is working now having switched the base frequency from 100 to 300, the auto-adjusting code is now kicking in as expected and my frequency is varying. Not retested the test case, but it's in the same code.py just commented out, no power off of the device has happened yet.
I'm now turning off the itsy (its in a device). I'll look properly tomorrow evening
Just to add it's still set at 300Hz and switched on fine this morning with speed varying as expected.
Leads me to believe it may have been from initialising the pwm pin at a fixed frequency of 100Hz when testing code initially (no variable frequency or False effectively), then soft rebooting and initialising at 100Hz with variable frequency True (no deinit performed?), at which point variable frequency was ignored.
Power cycling obviously cleared the state / masked the problem
Just to add it's still set at 300Hz and switched on fine this morning with speed varying as expected.
Leads me to believe it may have been from initialising the pwm pin at a fixed frequency of 100Hz when testing code initially (no variable frequency or False effectively), then soft rebooting and initialising at 100Hz with variable frequency True (no deinit performed?), at which point variable frequency was ignored.
Power cycling obviously cleared the state / masked the problem
Please post a small test case if you can reproduce it again. Otherwise, please close.
CircuitPython version
Code/REPL
Behavior
Description
It's probably easier to use the adapted code from the essentials example, tweaked for the itsybitsy esp32, from here: https://learn.adafruit.com/circuitpython-essentials/circuitpython-pwm#pwm-output-with-variable-frequency-2983842
Additional information
I can't vary the pwm freqency for a pin. I have duty cycle of 50%(~32k) or 0, and variable_frequency true, but my original frequency of 100 seems to remain despite assigning a new one in the
set_fan_frequency
method.