Skip to content

Commit 282e394

Browse files
committed
Document blocking argument on piezo
1 parent a8c225e commit 282e394

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

programming/sr/power/index.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ between `C6` and `C8`. You can play other tones by providing a frequency.
101101
<div class="info" markdown="1">
102102
Calling `buzz` is non-blocking, which means it doesn't actually wait
103103
for the piezo to stop buzzing before continuing with your code. If you
104-
want to wait for the buzzing to stop, add a `sleep` afterwards!
104+
want to wait for the buzzing to stop, use the <code>blocking</code> argument!
105105
</div>
106106

107107
~~~~~ python
@@ -112,6 +112,9 @@ R.power_board.piezo.buzz(0.5, Note.D6)
112112

113113
# Beep for 2s at 400Hz
114114
R.power_board.piezo.buzz(2, 400)
115+
116+
# Beep for 3s at 250Hz and wait for it to finish
117+
R.power_board.piezo.buzz(3, 250, blocking=True)
115118
~~~~~
116119

117120
`ValueError` is raised if the note is not recognised or the frequency is not an integer.

0 commit comments

Comments
 (0)