summaryrefslogtreecommitdiffstatshomepage
path: root/docs/library/machine.PWM.rst
diff options
context:
space:
mode:
authorrobert-hh <robert@hammelrath.com>2023-02-25 10:51:56 +0100
committerDamien George <damien@micropython.org>2023-05-04 13:15:55 +1000
commitdc8f9d22ca2ec9328b519e79013c97bbbe18b6c6 (patch)
treed4f5ce3e6f205e5b1c3dd541142395f3d60b0d1a /docs/library/machine.PWM.rst
parent84302b2854334371217015a5924978c009a94d30 (diff)
downloadmicropython-dc8f9d22ca2ec9328b519e79013c97bbbe18b6c6.tar.gz
micropython-dc8f9d22ca2ec9328b519e79013c97bbbe18b6c6.zip
docs: Update the PWM examples based on recent API improvements.
This adds the freq and duty_u16 keyword settings to the constructor, and sometimes other details in the PWM section. For mimxrt a clarification regarding the PWM invert argument was added, and for rp2 a few words were spent on PWM output pairs of a channel/slice.
Diffstat (limited to 'docs/library/machine.PWM.rst')
-rw-r--r--docs/library/machine.PWM.rst3
1 files changed, 2 insertions, 1 deletions
diff --git a/docs/library/machine.PWM.rst b/docs/library/machine.PWM.rst
index 4b74355775..d6c5de4b24 100644
--- a/docs/library/machine.PWM.rst
+++ b/docs/library/machine.PWM.rst
@@ -10,7 +10,8 @@ Example usage::
from machine import PWM
- pwm = PWM(pin) # create a PWM object on a pin
+ pwm = PWM(pin, freq=50, duty_u16=8192) # create a PWM object on a pin
+ # and set freq and duty
pwm.duty_u16(32768) # set duty to 50%
# reinitialise with a period of 200us, duty of 5us