File: pwm.rst

package info (click to toggle)
python-periphery 2.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 424 kB
  • sloc: python: 3,496; makefile: 21
file content (38 lines) | stat: -rw-r--r-- 552 bytes parent folder | download | duplicates (3)
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: