|
| 1 | +Atomic Echo Base |
| 2 | +================ |
| 3 | + |
| 4 | +.. sku: A149 |
| 5 | +
|
| 6 | +.. include:: ../refs/base.echo.ref |
| 7 | + |
| 8 | +The following products are supported: |
| 9 | + |
| 10 | + |Atomic Echo Base| |
| 11 | + |
| 12 | +Below is the detailed support for Speaker on the host: |
| 13 | + |
| 14 | +.. table:: |
| 15 | + :widths: auto |
| 16 | + :align: center |
| 17 | + |
| 18 | + +-----------------+-------------------+ |
| 19 | + |Controller | Atomic Echo Base | |
| 20 | + +=================+===================+ |
| 21 | + | Atom Echo | |O| | |
| 22 | + +-----------------+-------------------+ |
| 23 | + | Atom Lite | |S| | |
| 24 | + +-----------------+-------------------+ |
| 25 | + | Atom Matrix | |S| | |
| 26 | + +-----------------+-------------------+ |
| 27 | + | AtomS3 | |S| | |
| 28 | + +-----------------+-------------------+ |
| 29 | + | AtomS3 Lite | |S| | |
| 30 | + +-----------------+-------------------+ |
| 31 | + | AtomS3R | |S| | |
| 32 | + +-----------------+-------------------+ |
| 33 | + | AtomS3R-CAM | |S| | |
| 34 | + +-----------------+-------------------+ |
| 35 | + | AtomS3R-Ext | |S| | |
| 36 | + +-----------------+-------------------+ |
| 37 | + |
| 38 | +.. |S| unicode:: U+2705 |
| 39 | +.. |O| unicode:: U+2B55 |
| 40 | + |
| 41 | + |
| 42 | +Micropython Example: |
| 43 | + |
| 44 | + .. literalinclude:: ../../../examples/base/echo/atoms3_echo_example.py |
| 45 | + :language: python |
| 46 | + :linenos: |
| 47 | + |
| 48 | + |
| 49 | +UIFLOW2 Example: |
| 50 | + |
| 51 | + |example.png| |
| 52 | + |
| 53 | + |
| 54 | +.. only:: builder_html |
| 55 | + |
| 56 | + |atoms3_echo_example.m5f2| |
| 57 | + |
| 58 | + |
| 59 | +class ATOMEchoBase |
| 60 | +------------------ |
| 61 | + |
| 62 | +Constructors |
| 63 | +------------ |
| 64 | + |
| 65 | +.. class:: ATOMEchoBase(i2c, address: int = 0x18, i2s_port: int = 1, sample_rate: int = 44100, i2s_sck: int = -1, i2s_ws: int = -1, i2s_di: int = -1, i2s_do: int = -1) |
| 66 | + |
| 67 | + Create an ATOMEchoBase object. |
| 68 | + |
| 69 | + :param I2C i2c: I2C object |
| 70 | + :param int address: The I2C address of the ES8311. Default is 0x18. |
| 71 | + :param int i2s_port: The I2S port number. Default is 1. |
| 72 | + :param int sample_rate: The sample rate of the audio. Default is 44100. |
| 73 | + :param int i2s_sck: The I2S SCK pin. Default is -1. |
| 74 | + :param int i2s_ws: The I2S WS pin. Default is -1. |
| 75 | + :param int i2s_di: The I2S DI pin. Default is -1. |
| 76 | + :param int i2s_do: The I2S DO pin. Default is -1. |
| 77 | + |
| 78 | + UIFLOW2: |
| 79 | + |
| 80 | + |init.png| |
| 81 | + |
| 82 | + Micropython:: |
| 83 | + |
| 84 | + from hardware import I2C |
| 85 | + from hardware import Pin |
| 86 | + from base import ATOMEchoBase |
| 87 | + |
| 88 | + # atom echo |
| 89 | + i2c1 = I2C(1, scl=Pin(21), sda=Pin(25), freq=100000) |
| 90 | + echo = ATOMEchoBase(i2c1, address=0x18, i2s_port=1, sample_rate=44100, i2s_sck=33, i2s_ws=19, i2s_di=23, i2s_do=22) |
| 91 | + |
| 92 | + # atom lite |
| 93 | + i2c1 = I2C(1, scl=Pin(21), sda=Pin(25), freq=100000) |
| 94 | + echo = ATOMEchoBase(i2c1, address=0x18, i2s_port=1, sample_rate=44100, i2s_sck=33, i2s_ws=19, i2s_di=23, i2s_do=22) |
| 95 | + |
| 96 | + # atom matrix |
| 97 | + i2c1 = I2C(1, scl=Pin(21), sda=Pin(25), freq=100000) |
| 98 | + echo = ATOMEchoBase(i2c1, address=0x18, i2s_port=1, sample_rate=44100, i2s_sck=33, i2s_ws=19, i2s_di=23, i2s_do=22) |
| 99 | + |
| 100 | + # atoms3 / atoms3 lite |
| 101 | + i2c1 = I2C(1, scl=Pin(39), sda=Pin(38), freq=100000) |
| 102 | + echo = ATOMEchoBase(i2c1, address=0x18, i2s_port=1, sample_rate=44100, i2s_sck=8, i2s_ws=6, i2s_di=7, i2s_do=5) |
| 103 | + |
| 104 | + # atoms3r / atoms3r-cam / atoms3-ext |
| 105 | + i2c1 = I2C(1, scl=Pin(39), sda=Pin(38), freq=100000) |
| 106 | + echo = ATOMEchoBase(i2c1, address=0x18, i2s_port=1, sample_rate=44100, i2s_sck=8, i2s_ws=6, i2s_di=7, i2s_do=5) |
| 107 | + |
| 108 | + echo.speaker.tone(2000, 1000) |
| 109 | + echo.speaker.playWavFile('res/audio/66.wav') |
| 110 | + |
| 111 | + |
| 112 | +Attributes |
| 113 | +---------- |
| 114 | + |
| 115 | +.. attribute:: ATOMEchoBase.speaker |
| 116 | + |
| 117 | + Objects of the Speaker class. |
| 118 | + |
| 119 | + See :ref:`hardware.Speaker.Methods <hardware.Speaker.Methods>` for more details on how to use the ATOMEchoBase.speaker properties. |
| 120 | + |
| 121 | +.. attribute:: ATOMEchoBase.microphone |
| 122 | + |
| 123 | + Objects of the Microphone class. |
| 124 | + |
| 125 | + See :ref:`hardware.Mic.Methods <hardware.Mic.Methods>` for more details on how to use the ATOMEchoBase.microphone properties. |
| 126 | + |
| 127 | + .. Note:: Microphone is not quite ready yet. |
0 commit comments