Skip to content

Commit c8dc091

Browse files
committed
shared-bindings: Fix duty_cycle parameter description and error message.
1 parent b5f50fa commit c8dc091

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

shared-bindings/pulseio/PWMOut.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
//| fixed outputs first.
5252
//|
5353
//| :param ~microcontroller.Pin pin: The pin to output to
54-
//| :param int duty: The fraction of each pulse which is high. 16-bit
54+
//| :param int duty_cycle: The fraction of each pulse which is high. 16-bit
5555
//| :param int frequency: The target frequency in Hertz (32-bit)
5656
//| :param bool variable_frequency: True if the frequency will change over time
5757
//|
@@ -155,7 +155,7 @@ STATIC mp_obj_t pulseio_pwmout_obj_set_duty_cycle(mp_obj_t self_in, mp_obj_t dut
155155
pulseio_pwmout_obj_t *self = MP_OBJ_TO_PTR(self_in);
156156
mp_int_t duty = mp_obj_get_int(duty_cycle);
157157
if (duty < 0 || duty > 0xffff) {
158-
mp_raise_ValueError("PWM duty must be between 0 and 65536 (16 bit resolution)");
158+
mp_raise_ValueError("PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)");
159159
}
160160
common_hal_pulseio_pwmout_set_duty_cycle(self, duty);
161161
return mp_const_none;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy