diff --git a/doc/api/index.rst b/doc/api/index.rst index 7cd74a4..991f147 100644 --- a/doc/api/index.rst +++ b/doc/api/index.rst @@ -26,6 +26,7 @@ Intro parameters tools robotics + media .. toctree:: :maxdepth: 1 diff --git a/doc/api/media.rst b/doc/api/media.rst new file mode 100644 index 0000000..0ed902b --- /dev/null +++ b/doc/api/media.rst @@ -0,0 +1,29 @@ +:mod:`media` -- Sounds and Images +============================================= + +You can use your own sound and image files by placing them in your project +folder. You can also use any of the images and sounds built into Pybricks. + +ev3dev +------ + +These images and sounds are only available for Pybricks on ev3dev. Example:: + + # Imports + from pybricks.hubs import EV3Brick + from pybricks.media.ev3dev import SoundFile, ImageFile + + # Initialize the EV3 brick + brick = EV3Brick() + + # Show an image file + brick.display.image(ImageFile.AWAKE) + + # Play a sound file + brick.speaker.file(SoundFile.HELLO) + +.. autoclass:: pybricks.media.ev3dev.ImageFile + :no-members: + +.. autoclass:: pybricks.media.ev3dev.SoundFile + :no-members: diff --git a/doc/api/parameters.rst b/doc/api/parameters.rst index f1c58c6..5a5950a 100644 --- a/doc/api/parameters.rst +++ b/doc/api/parameters.rst @@ -36,12 +36,6 @@ .. autoclass:: pybricks.parameters.Align :no-members: -.. autoclass:: pybricks.parameters.ImageFile - :no-members: - -.. autoclass:: pybricks.parameters.SoundFile - :no-members: - .. autoclass:: pybricks.parameters.Axis :no-members: