Skip to main content

pin.getdutycycle()

Returns the specified PWM output pin’s current duty cycle

Availability

Device

Returns

Float — the duty cycle as a value between 0.0 and 1.0

Description

This method provides the actual pulse-width modulation duty cycle as a value between 0.0 and 1.0. This is the case even if the PWM is running in ‘zombie’ mode, ie. it continues to operate across Squirrel reloads, firmware upgrades and device restarts.