Skip to content

Commit e6dc0e3

Browse files
authored
Update README.rst
added usage example for Circuit Playground Express
1 parent 5d11c72 commit e6dc0e3

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

README.rst

+16
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,22 @@ This plays Frosty the Snowman:
3939
4040
adafruit_rtttl.play(board.A0, "Snowman:d=8,o=5,b=200:2g,4e.,f,4g,2c6,b,c6,4d6,4c6,4b,a,2g.,b,c6,4d6,4c6,4b,a,a,g,4c6,4e.,g,a,4g,4f,4e,4d,2c.,4c,4a,4a,4c6,4c6,4b,4a,4g,4e,4f,4a,4g,4f,2e.,4e,4d,4d,4g,4g,4b,4b,4d6,d6,b,4d6,4c6,4b,4a,4g,4p,2g")
4141
42+
CPX Usage Example
43+
=============
44+
45+
This plays Frosty the Snowman on a Circuit Playground Express (we must enable onboard speaker):
46+
47+
.. code-block:: python
48+
49+
import board
50+
from digitalio import DigitalInOut, Direction
51+
import adafruit_rtttl
52+
spkrenable = DigitalInOut(board.SPEAKER_ENABLE)
53+
spkrenable.direction = Direction.OUTPUT
54+
spkrenable.value = True
55+
56+
adafruit_rtttl.play(board.A0, "Snowman:d=8,o=5,b=200:2g,4e.,f,4g,2c6,b,c6,4d6,4c6,4b,a,2g.,b,c6,4d6,4c6,4b,a,a,g,4c6,4e.,g,a,4g,4f,4e,4d,2c.,4c,4a,4a,4c6,4c6,4b,4a,4g,4e,4f,4a,4g,4f,2e.,4e,4d,4d,4g,4g,4b,4b,4d6,d6,b,4d6,4c6,4b,4a,4g,4p,2g")
57+
4258
Contributing
4359
============
4460

0 commit comments

Comments
 (0)