diff options
| author | Jeff Epler <jepler@gmail.com> | 2021-04-01 09:37:39 -0500 |
|---|---|---|
| committer | Jeff Epler <jepler@gmail.com> | 2021-04-01 10:06:59 -0500 |
| commit | 489163b74edf9d6f40b3d9e6ee0154d2f1ddce79 (patch) | |
| tree | df58719efd11aca997a6cac8584585bec289b0c2 /tests/bytecode/mp-tests | |
| parent | d0ba75e6dc7e88bf9242ec433a38aba8c085482e (diff) | |
mimxrt1011: pwmio: Enable basic PWMOut functionality
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.
Diffstat (limited to 'tests/bytecode/mp-tests')
0 files changed, 0 insertions, 0 deletions
