diff --git a/python/genindex.html b/python/genindex.html index 884d41ce8..cd3932e56 100644 --- a/python/genindex.html +++ b/python/genindex.html @@ -267,6 +267,8 @@
set_led_all()
set_led_toggle()
set_neopixel()
set_pwm_channel_duty_cycle()
set_pwm_channel_value()
set_pwm_channels_value()
set_pwm_channels_values()
Sets the duty cycle (the proportion of ON time) for the selected PWM channel.
+Similar to set_pwm_channel_value()
, this function calculate the OFF counter
+value to match desired PWM channel’s duty_cyle.
Notes
+A duty cycle of 1.0 or 0.0 acts like a relay.
+Details of counters on IC, check set_pwm_channel_value()
.
channel (PwmChannel
) – The channel to be selected for PWM.
duty_cycle (f32) – Duty cycle count value (0.0 : 1.0).
Examples
+>>> import bluerobotics_navigator as navigator
+
>>> from bluerobotics_navigator import PwmChannel
+
>>> navigator.init()
+
>>> navigator.set_pwm_freq_hz(1000)
+
>>> navigator.set_pwm_channel_duty_cycle(PwmChannel.Ch1, 0.5)
+
>>> navigator.set_pwm_enable(True)
+