This commit is contained in:
Stefan Ostermann 2023-06-17 00:10:38 +02:00
parent b6f72130a2
commit 35d62e9bf0
2 changed files with 21 additions and 2 deletions

View File

@ -26,8 +26,13 @@ CLK -> D5
MISO -> D6
```
## TODOs
* Card Reader with SPI. Configure hspi, second SPI channel?
![](images/wemos-d1-mini-esp32.png)
## Links
https://github.com/earlephilhower/ESP8266Audio
[Running two SPI devices at once](https://randomnerdtutorials.com/esp32-spi-communication-arduino/)

View File

@ -30,6 +30,8 @@ const int startDelay = 250;
Audio audio;
uint volume = 18;
AsyncWebServer server(80);
DNSServer dns;
@ -69,6 +71,18 @@ void audio_info(const char *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 state = String();
@ -133,7 +147,7 @@ void start()
}
void next()
{
{
playNextMp3();
}
@ -170,7 +184,7 @@ void setup()
// printDirectory(root, 0);
audio.setPinout(I2S_BCLK, I2S_LRC, I2S_DOUT);
audio.setVolume(12); // 0...21
audio.setVolume(volume); // 0...21
server.on("/", HTTP_GET, [](AsyncWebServerRequest *request)
{ request->send_P(200, "text/html", index_html, processor); });