- MicroPython Cookbook
- Marwan Alsabbagh
- 62字
- 2021-06-24 14:28:09
How to do it...
Let's perform the following steps:
- Run the following lines of code in the REPL. You should hear a beeping sound at a frequency of 900 Hz played for 0.2 seconds:
>>> from adafruit_circuitplayground.express import cpx >>> cpx.play_tone(900, 0.2)
- Execute the following code so that a lower frequency beep will be played for a longer duration:
>>> cpx.play_tone(500, 0.4)