Skip to content

Instantly share code, notes, and snippets.

@boochow
Last active October 13, 2018 10:01
Show Gist options
  • Save boochow/225d871c844541b3c0791834fbfdf6ab to your computer and use it in GitHub Desktop.
Save boochow/225d871c844541b3c0791834fbfdf6ab to your computer and use it in GitHub Desktop.
def test2():
saw = []
sqw = []
tri = []
for i in range(64):
saw.append(i*4)
sqw.append(255 if i < 32 else 0)
tri.append(abs(i - 32)*8)
p=PWM(0, pin=18, ms=MS_DISABLE, use_fifo=1, fifo_repeat=0)
p.range(256)
PWM_clock_config(CLK_OSC, 2)
while True:
for i in range(1000):
p.fifo_write(saw)
for i in range(1000):
p.fifo_write(sqw)
for i in range(1000):
p.fifo_write(tri)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment