16 lines
252 B
Python
16 lines
252 B
Python
|
from machine import Pin
|
||
|
from machine import PWM
|
||
|
from time import sleep
|
||
|
|
||
|
led = PWM(Pin(0, Pin.OUT))
|
||
|
|
||
|
for i in range(-1, 1024, 8):
|
||
|
led.duty(i)
|
||
|
print(i)
|
||
|
sleep(0.1)
|
||
|
|
||
|
for i in range(1023, -1, -8):
|
||
|
led.duty(i)
|
||
|
print(i)
|
||
|
sleep(0.1)
|