pwm. Object

The pwm. object icon.

The pwm. object represents the PWM interface of your device. On devices that support PWM — currently only the WM2000 — such functionality can be mapped to some general-purpose I/O (GPIO) lines.

PWM functionality is controlled via the pwm. object, which has four properties — pwm.num, pwm.dutycycle, pwm.enabled, and pwm.frequency — and two methods: pwm.update and pwm.updateall.

The pwm. object allows you to map and enable PWM functionality to specific GPIO lines, define the duty cycle and frequency of the modulation, and update the PWM channels' state.