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.
383
383
384
384
Use the :ref: `machine.PWM <machine.PWM >` class::
385
385
386
- from machine import Pin, PWM
386
+ from machine import Pin, PWM, lightsleep
387
387
388
388
pwm0 = PWM(Pin(0), freq=5000, duty_u16=32768) # create PWM object from a pin
389
389
freq = pwm0.freq() # get current frequency
@@ -409,6 +409,9 @@ Use the :ref:`machine.PWM <machine.PWM>` class::
409
409
410
410
pwm4 = PWM(Pin(4), lightsleep=True) # Allow PWM during light sleep mode
411
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
+
412
415
ESP chips have different hardware peripherals:
413
416
414
417
======================================================= ======== ========= ==========
You can’t perform that action at this time.
0 commit comments