Skip to content

Instantly share code, notes, and snippets.

@boochow
Created October 7, 2018 07:23
Show Gist options
  • Save boochow/1303fd200544f16ebc781041e6ef8ba7 to your computer and use it in GitHub Desktop.
Save boochow/1303fd200544f16ebc781041e6ef8ba7 to your computer and use it in GitHub Desktop.
from time import sleep_ms
def test():
p=PWM(0, pin=18, ms=MS_ENABLE)
p.freq(1000)
p.range(DEFAULT_RANGE)
while True:
for i in range(DEFAULT_RANGE // 2):
p.data(i)
sleep_ms(1)
for i in range(DEFAULT_RANGE // 2 - 1, 0, -1):
p.data(i)
sleep_ms(1)
test()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment