User Tools

Site Tools


esp32:ttgo_taudio_v1.6_esp32-wrover

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
esp32:ttgo_taudio_v1.6_esp32-wrover [2021/06/19 17:32] – aistisesp32:ttgo_taudio_v1.6_esp32-wrover [2021/06/25 12:29] (current) – aistis
Line 1: Line 1:
-TTGO TAudio V1.6 ESP32-WROVER+TTGO TAudio V1.6 ESP32-WROVER esp32 audio i2s 
  
 https://github.com/LilyGO/TTGO-TAudio https://github.com/LilyGO/TTGO-TAudio
Line 5: Line 6:
  
 {{:esp32:pasted:20210619-172539.png}} {{:esp32:pasted:20210619-172539.png}}
 +
 +veikiantis grojimo kodas:
 +
 +<code cpp>
 +
 +/* TTGO T-Audio I2C pins */
 +#define I2C_SDA     19
 +#define I2C_SCL     18
 +
 +/* TTGO T-Audio pins */
 +#define I2S_BCK     33
 +#define I2S_WS      25
 +#define I2S_DOUT    26
 +#define I2S_DIN     27
 +
 +#include <Wire.h>
 +#include <WM8978.h> /* https://github.com/CelliesProjects/wm8978-esp32 */
 +#include <Audio.h>  /* https://github.com/schreibfaul1/ESP32-audioI2S */
 +
 +/* M5Stack WM8978 MCLK gpio number */
 +#define I2S_MCLKPIN  0
 +
 +WM8978 dac;
 +Audio audio;
 +
 +void setup() {
 +
 +    ESP_LOGI(TAG, "aaa");
 +
 +  if (!Wire.begin(21, 22, 400000))
 +    ESP_LOGE(TAG, "i2c setup error!");
 +
 +  if (!dac.begin())
 +    ESP_LOGE(TAG, "WM8978 setup error!");
 +
 +  dac.setSPKvol(63); /* max 63 */
 +  dac.setHPvol(32, 32);
 +
 +  WiFi.begin("aistiss", "77777777");
 +  while (!WiFi.isConnected()) {
 +    delay(10);
 +  }
 +
 +  /* set i2s pins */
 +  audio.setPinout(I2S_BCK, I2S_WS, I2S_DOUT);
 +
 +  /* Start MCLK */
 +  audio.i2s_mclk_pin_select(I2S_MCLKPIN);
 +
 +  ESP_LOGI(TAG, "Connected. Starting MP3...");
 +  audio.connecttohost("http://icecast.omroep.nl/3fm-bb-mp3");
 +//audio.connecttohost("https://file-examples-com.github.io/uploads/2017/11/file_example_MP3_700KB.mp3");
 +}
 +
 +void loop() {
 +  audio.loop();
 +}
 +</code>
esp32/ttgo_taudio_v1.6_esp32-wrover.1624113128.txt.gz · Last modified: by aistis