8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9ea0573 commit 850146eCopy full SHA for 850146e
docs/esp32/quickref.rst
@@ -383,7 +383,7 @@ for more details.
383
384
Use the :ref:`machine.PWM <machine.PWM>` class::
385
386
- from machine import Pin, PWM
+ from machine import Pin, PWM, lightsleep
387
388
pwm0 = PWM(Pin(0), freq=5000, duty_u16=32768) # create PWM object from a pin
389
freq = pwm0.freq() # get current frequency
@@ -409,6 +409,9 @@ Use the :ref:`machine.PWM <machine.PWM>` class::
409
410
pwm4 = PWM(Pin(4), lightsleep=True) # Allow PWM during light sleep mode
411
412
+ lightsleep(10*1000) # pwm0, pwm2 goes off, pwm4 stays on during 10s light sleep
413
+ # pwm0, pwm2, pwm4 on after 10s light sleep
414
+
415
ESP chips have different hardware peripherals:
416
417
======================================================= ======== ========= ==========
0 commit comments