circuitpython/ports/nrf/examples/nrf52_pwm.py
Damien George 69661f3343 all: Reformat C and Python source code with tools/codeformat.py.
This is run with uncrustify 0.70.1, and black 19.10b0.
2020-02-28 10:33:03 +11:00

17 lines
419 B
Python

import time
from machine import PWM, Pin
def pulse():
for i in range(0, 101):
p = PWM(0, Pin("P17", 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("P17", mode=Pin.OUT), freq=PWM.FREQ_16MHZ, duty=100 - i, period=16000)
p.init()
time.sleep_ms(10)
p.deinit()