...
This commit is contained in:
parent
b6f72130a2
commit
35d62e9bf0
|
|
@ -26,8 +26,13 @@ CLK -> D5
|
||||||
MISO -> D6
|
MISO -> D6
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## TODOs
|
||||||
|
* Card Reader with SPI. Configure hspi, second SPI channel?
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
## Links
|
## Links
|
||||||
|
|
||||||
https://github.com/earlephilhower/ESP8266Audio
|
https://github.com/earlephilhower/ESP8266Audio
|
||||||
|
|
||||||
|
[Running two SPI devices at once](https://randomnerdtutorials.com/esp32-spi-communication-arduino/)
|
||||||
|
|
|
||||||
18
src/main.cpp
18
src/main.cpp
|
|
@ -30,6 +30,8 @@ const int startDelay = 250;
|
||||||
|
|
||||||
Audio audio;
|
Audio audio;
|
||||||
|
|
||||||
|
uint volume = 18;
|
||||||
|
|
||||||
AsyncWebServer server(80);
|
AsyncWebServer server(80);
|
||||||
DNSServer dns;
|
DNSServer dns;
|
||||||
|
|
||||||
|
|
@ -69,6 +71,18 @@ void audio_info(const char *info)
|
||||||
// Serial.print("info "); Serial.println(info);
|
// Serial.print("info "); Serial.println(info);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void mute() {
|
||||||
|
if (audio.getVolume()!=0) {
|
||||||
|
volume = audio.getVolume();
|
||||||
|
}
|
||||||
|
|
||||||
|
audio.setVolume(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void unmute() {
|
||||||
|
audio.setVolume(volume);
|
||||||
|
}
|
||||||
|
|
||||||
String getState()
|
String getState()
|
||||||
{
|
{
|
||||||
String state = String();
|
String state = String();
|
||||||
|
|
@ -133,7 +147,7 @@ void start()
|
||||||
}
|
}
|
||||||
|
|
||||||
void next()
|
void next()
|
||||||
{
|
{
|
||||||
playNextMp3();
|
playNextMp3();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -170,7 +184,7 @@ void setup()
|
||||||
|
|
||||||
// printDirectory(root, 0);
|
// printDirectory(root, 0);
|
||||||
audio.setPinout(I2S_BCLK, I2S_LRC, I2S_DOUT);
|
audio.setPinout(I2S_BCLK, I2S_LRC, I2S_DOUT);
|
||||||
audio.setVolume(12); // 0...21
|
audio.setVolume(volume); // 0...21
|
||||||
|
|
||||||
server.on("/", HTTP_GET, [](AsyncWebServerRequest *request)
|
server.on("/", HTTP_GET, [](AsyncWebServerRequest *request)
|
||||||
{ request->send_P(200, "text/html", index_html, processor); });
|
{ request->send_P(200, "text/html", index_html, processor); });
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue