Skip to content

Latest commit

 

History

History
38 lines (26 loc) · 551 Bytes

pwm.rst

File metadata and controls

38 lines (26 loc) · 551 Bytes

PWM

Code Example

from periphery import PWM

# Open PWM channel 0, pin 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: