Skip to content

Commit 39d25d1

Browse files
authored
Merge pull request #379 from srobo/update-buzz-docs
Update `buzz` docs
2 parents 818d21e + 282e394 commit 39d25d1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

programming/sr/power/index.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +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!
105-
If you send more than 32 beeps to the robot too quickly, your power board will crash!
104+
want to wait for the buzzing to stop, use the <code>blocking</code> argument!
106105
</div>
107106

108107
~~~~~ python
@@ -113,6 +112,9 @@ R.power_board.piezo.buzz(0.5, Note.D6)
113112

114113
# Beep for 2s at 400Hz
115114
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)
116118
~~~~~
117119

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

0 commit comments

Comments
 (0)