2016-12-20 17:21:17 -05:00
|
|
|
import time
|
2016-12-23 19:16:23 -05:00
|
|
|
from machine import PWM, Pin
|
2016-12-20 17:21:17 -05:00
|
|
|
|
|
|
|
def pulse():
|
|
|
|
for i in range(0, 101):
|
2016-12-29 02:53:38 -05:00
|
|
|
p = PWM(0, Pin("A17", mode=Pin.OUT), freq=PWM.FREQ_16MHZ, duty=i, period=16000)
|
2016-12-31 11:21:38 -05:00
|
|
|
p.init()
|
2016-12-20 17:21:17 -05:00
|
|
|
time.sleep_ms(10)
|
2016-12-31 11:21:38 -05:00
|
|
|
p.deinit()
|
|
|
|
|
2016-12-20 17:21:17 -05:00
|
|
|
for i in range(0, 101):
|
2016-12-29 02:53:38 -05:00
|
|
|
p = PWM(0, Pin("A17", mode=Pin.OUT), freq=PWM.FREQ_16MHZ, duty=100-i, period=16000)
|
2016-12-31 11:21:38 -05:00
|
|
|
p.init()
|
2016-12-20 17:21:17 -05:00
|
|
|
time.sleep_ms(10)
|
2016-12-31 11:21:38 -05:00
|
|
|
p.deinit()
|