You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
61 lines
1.2 KiB
61 lines
1.2 KiB
#pragma mark - Depend btAudio library
|
|
/*
|
|
cd ~/Arduino/libraries
|
|
git clone https://github.com/tierneytim/btAudio
|
|
|
|
For more examples, please refer to btAudio
|
|
|
|
* */
|
|
|
|
|
|
#include "config.h"
|
|
#include <btAudio.h>
|
|
#include<webDSP.h>
|
|
|
|
TTGOClass *ttgo;
|
|
TFT_eSPI *tft ;
|
|
|
|
// Sets the name of the audio device
|
|
btAudio audio = btAudio("ESP_Speaker");
|
|
|
|
// create webserver object
|
|
webDSP web;
|
|
|
|
void setup(void)
|
|
{
|
|
Serial.begin(115200);
|
|
|
|
ttgo = TTGOClass::getWatch();
|
|
ttgo->begin();
|
|
ttgo->openBL();
|
|
|
|
//! Create a new pointer to save the display object
|
|
tft = ttgo->tft;
|
|
tft->setTextFont(2);
|
|
tft->println("bluetooth audio example");
|
|
|
|
//! Open aduio power
|
|
ttgo->enableLDO3();
|
|
|
|
// start bluetooth audio
|
|
audio.begin();
|
|
|
|
// attach to pins
|
|
int bck = TWATCH_DAC_IIS_BCK;
|
|
int ws = TWATCH_DAC_IIS_WS;
|
|
int dout = TWATCH_DAC_IIS_DOUT;
|
|
audio.I2S(bck, dout, ws);
|
|
|
|
// replace ssid and password with your details
|
|
const char *ssid = "";
|
|
const char *password = "";
|
|
web.begin(ssid, password, &audio);
|
|
|
|
|
|
}
|
|
|
|
void loop(void)
|
|
{
|
|
// continually check on client
|
|
web._server.handleClient();
|
|
}
|