mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-09-12 01:24:17 +00:00
doc: document new media submodule
This commit is contained in:
@@ -26,6 +26,7 @@ Intro
|
||||
parameters
|
||||
tools
|
||||
robotics
|
||||
media
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
@@ -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:
|
||||
@@ -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:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user