File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -101,7 +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 !
104
+ want to wait for the buzzing to stop, use the < code >blocking</ code > argument !
105
105
</div >
106
106
107
107
~~~~~ python
@@ -112,6 +112,9 @@ R.power_board.piezo.buzz(0.5, Note.D6)
112
112
113
113
# Beep for 2s at 400Hz
114
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 )
115
118
~~~~~
116
119
117
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