File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -383,7 +383,7 @@ for more details.
383383
384384Use the :ref: `machine.PWM <machine.PWM >` class::
385385
386- from machine import Pin, PWM
386+ from machine import Pin, PWM, lightsleep
387387
388388 pwm0 = PWM(Pin(0), freq=5000, duty_u16=32768) # create PWM object from a pin
389389 freq = pwm0.freq() # get current frequency
@@ -409,6 +409,9 @@ Use the :ref:`machine.PWM <machine.PWM>` class::
409409
410410 pwm4 = PWM(Pin(4), lightsleep=True) # Allow PWM during light sleep mode
411411
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+
412415ESP chips have different hardware peripherals:
413416
414417======================================================= ======== ========= ==========
You can’t perform that action at this time.
0 commit comments