from machine import Pin,PWM
import time
#PWM 腳位
sg_pin = PWM(Pin(15),freq=611,duty=0) #freq 1 ~ 40MHz
d = [0,255,511,767,1023] #duty 0 ~ 1023
while 1:
for i in d:
sg_pin.duty(i)
time.sleep(0.5)
print(i)
from machine import Pin,PWM
import time
#PWM 腳位
sg_pin = PWM(Pin(15),freq=611,duty=0) #freq 1 ~ 40MHz
d = [0,255,511,767,1023] #duty 0 ~ 1023
while 1:
for i in d:
sg_pin.duty(i)
time.sleep(0.5)
print(i)