circuitpython/nrf/examples/nrf52_pwm.py
Daniel Tralamazza e5802fd9f8 implement #50
2017-06-07 18:57:47 +02:00

16 lines
416 B
Python

import time
from machine import PWM, Pin
def pulse():
for i in range(0, 101):
p = PWM(0, Pin("A17", mode=Pin.OUT), freq=PWM.FREQ_16MHZ, duty=i, period=16000)
p.init()
time.sleep_ms(10)
p.deinit()
for i in range(0, 101):
p = PWM(0, Pin("A17", mode=Pin.OUT), freq=PWM.FREQ_16MHZ, duty=100-i, period=16000)
p.init()
time.sleep_ms(10)
p.deinit()