16 lines
330 B
Python
16 lines
330 B
Python
from machine import PWM, Pin
|
|
from time import sleep
|
|
|
|
outPin = 16
|
|
analogeOutput = PWM(Pin(outPin))
|
|
analogeOutput.freq(1000)
|
|
|
|
while True:
|
|
for i in range(0, 65535, 1000):
|
|
analogeOutput.duty_u16(i)
|
|
sleep(.1)
|
|
|
|
for i in range(65535, 0, -1000):
|
|
analogeOutput.duty_u16(i)
|
|
sleep(.1)
|
|
|