1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
PWM
===
Code Example
------------
.. code-block:: python
from periphery import PWM
# Open PWM chip 0, channel 10
pwm = PWM(0, 10)
# Set frequency to 1 kHz
pwm.frequency = 1e3
# Set duty cycle to 75%
pwm.duty_cycle = 0.75
pwm.enable()
# Change duty cycle to 50%
pwm.duty_cycle = 0.50
pwm.close()
API
---
.. autoclass:: periphery.PWM
:members:
:undoc-members:
:show-inheritance:
.. autoclass:: periphery.PWMError
:members:
:undoc-members:
:show-inheritance:
|