@@ -61,12 +61,35 @@ Methods
61
61
62
62
Disable the PWM output.
63
63
64
+ .. method :: PWM.freq([value])
65
+
66
+ Get or set the current frequency of the PWM output.
67
+
68
+ With no arguments the frequency in Hz is returned.
69
+
70
+ With a single *value * argument the frequency is set to that value in Hz. The
71
+ method may raise a ``ValueError `` if the frequency is outside the valid range.
72
+
64
73
.. method :: PWM.duty_ticks(ticks)
65
74
66
75
Change the duty cycle of the output, with the argument *ticks * measured in
67
76
``ticks_hz `` as set by the constructor or ``PWM.init ``. For example, if
68
77
``ticks_hz `` is 1000 then *ticks * is measured in milliseconds.
69
78
70
- .. method :: PWM.duty_u16(u16)
79
+ .. method :: PWM.duty_u16([value])
80
+
81
+ Get or set the current duty cycle of the PWM output, as an unsigned 16-bit
82
+ value in the range 0 to 65535 inclusive.
83
+
84
+ With no arguments the duty cycle is returned.
85
+
86
+ With a single *value * argument the duty cycle is set to that value, measured
87
+ as the ratio ``value / 65535 ``.
88
+
89
+ .. method :: PWM.duty_ns([value])
90
+
91
+ Get or set the current duty cycle of the PWM output, as a value in nanoseconds.
92
+
93
+ With no arguments the duty cycle in nanoseconds is returned.
71
94
72
- Change the duty cycle of the output, measured as the ratio `` u16 / 65535 `` .
95
+ With a single * value * argument the duty cycle is set to that value .
0 commit comments