Last active
October 13, 2018 10:01
-
-
Save boochow/225d871c844541b3c0791834fbfdf6ab to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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