489163b74e
After this change, the following program works for me on the MIMXRT1010-EVK: ```python import pwmio import board p = pwmio.PWMOut(board.D13, frequency=1_000_000, variable_frequency=True) p.duty_cycle = 32868 while True: pass ``` Querying and varying the duty_cycle and frequency work as well. The lowest frequency obtainable is about 2kHz; there is an additional divider which would allow lower PWM frequencies (I think 1kHz is important for servos?) Something odd happens with very low duty cycles, such as ```python >>> p.frequency = 2000 >>> p.duty_cycle = 2 ``` instead of a symmetrical waveform, it's asymmetrical. With `duty_cycle=4`, the effect disappears. The reason for this is probably hidden in the datasheet, but could affect servos or other things that count pulse widths. |
||
---|---|---|
.. | ||
analogio | ||
board | ||
busio | ||
digitalio | ||
displayio | ||
microcontroller | ||
neopixel_write | ||
os | ||
pulseio | ||
pwmio | ||
rtc | ||
supervisor |