File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -101,8 +101,7 @@ between `C6` and `C8`. You can play other tones by providing a frequency.
101
101
<div class =" info " markdown =" 1 " >
102
102
Calling ` buzz ` is non-blocking, which means it doesn't actually wait
103
103
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!
106
105
</div >
107
106
108
107
~~~~~ python
@@ -113,6 +112,9 @@ R.power_board.piezo.buzz(0.5, Note.D6)
113
112
114
113
# Beep for 2s at 400Hz
115
114
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 )
116
118
~~~~~
117
119
118
120
` ValueError ` is raised if the note is not recognised or the frequency is not an integer.
You can’t perform that action at this time.
0 commit comments