Buttons
This commit is contained in:
parent
cbbc9154db
commit
75e6413693
|
|
@ -107,6 +107,14 @@ Previous -> 16 and GND
|
|||
|
||||

|
||||
|
||||
|
||||
## Schematic without modules
|
||||
### Charging circuit
|
||||
https://ww1.microchip.com/downloads/en/AppNotes/01149c.pdf
|
||||
MCP73837 ?
|
||||
|
||||
|
||||
|
||||
## Links
|
||||
|
||||
https://github.com/earlephilhower/ESP8266Audio
|
||||
|
|
|
|||
20
src/main.cpp
20
src/main.cpp
|
|
@ -62,6 +62,8 @@ bool asyncStop = false;
|
|||
|
||||
bool asyncStart = false;
|
||||
|
||||
bool asyncTogglePlayPause = false;
|
||||
|
||||
std::map<String, String> 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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue