setPwmPeriod(pin, microseconds)
Sets the PWM (Pulse Width Modulation) wave period in microseconds (us).
Parameters
pin - The GPIO pin number.
microseconds - PWM frequency (in us).
Available ranges are between 52631 (19 hz) and 26 (37500 hz).
Returns
None
Example
Notes
- The default PWM frequency is 490 Hz
- PWM_OUTPUT mode uses the internal PWM hardware of the BCM283x SoC.
The available PWM pins are the followings:
GPIO PIN | Available in RPi (40-pins) connector | PWM channel |
---|---|---|
12 | YES | 0 |
13 | YES | 1 |
18 | YES | 0 |
19 | YES | 1 |
40 | NO | 0 |
41 | NO | 1 |
45 | NO | 1 |
52 | NO | 0 |
53 | NO | 1 |