diff options
author | IhorNehrutsa <ihor.nehrutsa@gmail.com> | 2025-03-13 13:46:46 +0200 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2025-05-16 12:37:25 +1000 |
commit | 9d565182d757e7a9bdf95bcb2b18fe2d6fa4111a (patch) | |
tree | 49b7a44346f6e9e8bf311a80e01519153cbc6c7c /docs/esp32 | |
parent | a72454519362dd1de5eff9e2eb268e6ea1040a40 (diff) | |
download | micropython-9d565182d757e7a9bdf95bcb2b18fe2d6fa4111a.tar.gz micropython-9d565182d757e7a9bdf95bcb2b18fe2d6fa4111a.zip |
docs/esp32/quickref: Add PWM lightsleep example.
Signed-off-by: Ihor Nehrutsa <Ihor.Nehrutsa@gmail.com>
Diffstat (limited to 'docs/esp32')
-rw-r--r-- | docs/esp32/quickref.rst | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/docs/esp32/quickref.rst b/docs/esp32/quickref.rst index 707ae27c08..56d8b0e4f6 100644 --- a/docs/esp32/quickref.rst +++ b/docs/esp32/quickref.rst @@ -383,7 +383,7 @@ for more details. Use the :ref:`machine.PWM <machine.PWM>` class:: - from machine import Pin, PWM + from machine import Pin, PWM, lightsleep pwm0 = PWM(Pin(0), freq=5000, duty_u16=32768) # create PWM object from a pin freq = pwm0.freq() # get current frequency @@ -409,6 +409,9 @@ Use the :ref:`machine.PWM <machine.PWM>` class:: pwm4 = PWM(Pin(4), lightsleep=True) # Allow PWM during light sleep mode + lightsleep(10*1000) # pwm0, pwm2 goes off, pwm4 stays on during 10s light sleep + # pwm0, pwm2, pwm4 on after 10s light sleep + ESP chips have different hardware peripherals: ======================================================= ======== ========= ========== |