Skip to content

Commit 29214c7

Browse files
committed
Change a couple of PIO examples to run at 2000Hz
Fixes raspberrypi#18
1 parent ca2cc66 commit 29214c7

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

pio/pio_blink.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ def blink():
1919
nop() [31]
2020
wrap()
2121

22-
# Instantiate a state machine with the blink program, at 1000Hz, with set bound to Pin(25) (LED on the rp2 board)
23-
sm = rp2.StateMachine(0, blink, freq=1000, set_base=Pin(25))
22+
# Instantiate a state machine with the blink program, at 2000Hz, with set bound to Pin(25) (LED on the rp2 board)
23+
sm = rp2.StateMachine(0, blink, freq=2000, set_base=Pin(25))
2424

2525
# Run the state machine for 3 seconds. The LED should blink.
2626
sm.active(1)
2727
time.sleep(3)
28-
sm.active(0)
28+
sm.active(0)

pio/pio_irq.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def irq_test():
1919

2020
rp2.PIO(0).irq(lambda pio: print(pio.irq().flags()))
2121

22-
sm = rp2.StateMachine(0, irq_test, freq=1000)
22+
sm = rp2.StateMachine(0, irq_test, freq=2000)
2323
sm.active(1)
2424
time.sleep(1)
25-
sm.active(0)
25+
sm.active(0)

0 commit comments

Comments
 (0)