Skip to content

Instantly share code, notes, and snippets.

@boochow
Created October 12, 2018 16:01
Show Gist options
  • Save boochow/3794f3a5794bab2d60d981bd874faa8b to your computer and use it in GitHub Desktop.
Save boochow/3794f3a5794bab2d60d981bd874faa8b to your computer and use it in GitHub Desktop.
from time import sleep_ms
from machine import PWM
def test():
p=PWM(pin=18)
while True:
for i in range(p.range() // 2):
p.data(i)
sleep_ms(1)
for i in range(p.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