diff --git a/README.md b/README.md index 49c340e..5302fc1 100644 --- a/README.md +++ b/README.md @@ -107,6 +107,14 @@ Previous -> 16 and GND ![](images/wemos-d1-mini-esp32.png) + +## Schematic without modules +### Charging circuit +https://ww1.microchip.com/downloads/en/AppNotes/01149c.pdf +MCP73837 ? + + + ## Links https://github.com/earlephilhower/ESP8266Audio diff --git a/src/main.cpp b/src/main.cpp index 3fb25a1..4f03d4b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -62,6 +62,8 @@ bool asyncStop = false; bool asyncStart = false; +bool asyncTogglePlayPause = false; + std::map rfid_map{{"67 152 204 14", "01-The_Box_Tops-The_Letter.mp3"}, {"67 175 148 160","068-Der_Schatz_im_Bergsee"}}; @@ -429,6 +431,11 @@ void loop() } else if (asyncStart) { asyncStart = false; start(); + } + + if (asyncTogglePlayPause) { + asyncTogglePlayPause = false; + togglePlayPause(); } rfid_loop--; @@ -448,20 +455,12 @@ void loop() void loop2(void *parameter) { + Serial.println("loop2 started"); for (;;) { if (buttonPressed(BTN_START_STOP)) { - if (audio.isRunning()) - { - asyncStop = true; - asyncStart = false; - } - else - { - asyncStart = true; - asyncStop = false; - } + asyncTogglePlayPause = true; } } } @@ -473,7 +472,6 @@ boolean buttonPressed(const uint8_t pin) unsigned long now = millis(); if (now - lastStart > startDelay) { - lastStart = now; return true; }