add more control buttons for testing
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
|
||||
Circuit:
|
||||
* LED attached to pin 13 (optional)
|
||||
* IR Transmitter attached to pin 4
|
||||
* IR Transmitter attached to pin 4 (needs 5v)
|
||||
* SD-Module to load HTML and CSS from SD-card
|
||||
|
||||
developed for the ESP32vn IoT Uni board 2024
|
||||
@@ -89,7 +89,12 @@ void loop() {
|
||||
// the content of the HTTP response follows the header:
|
||||
client.print("Click <a href=\"/H\">here</a> to turn the LED on pin 13 on.<br>");
|
||||
client.print("Click <a href=\"/L\">here</a> to turn the LED on pin 13 off.<br>");
|
||||
client.print("<a href=\"/power\">power</a><br>");
|
||||
client.print("<a href=\"/play\">play</a><br>");
|
||||
client.print("<a href=\"/pause\">pause</a><br>");
|
||||
client.print("<a href=\"/stop\">stop</a><br>");
|
||||
client.print("<a href=\"/prev\">previous track</a><br>");
|
||||
client.print("<a href=\"/next\">next track</a><br>");
|
||||
client.print("<form action=\"/api/control-deck\" method=\"post\"><button name=\"control\" type=\"submit\" value=\"play\">play</button></form><br>");
|
||||
client.print("<form action=\"/api/control-deck\" method=\"get\"><input name=\"textinput\" type=\"text\" /><button type=\"submit\">send</button></form><br>");
|
||||
|
||||
@@ -111,12 +116,24 @@ void loop() {
|
||||
if (currentLine.endsWith("GET /L")) {
|
||||
digitalWrite(LED_PIN, LOW); // GET /L turns the LED off
|
||||
}
|
||||
if (currentLine.endsWith("GET /power")) {
|
||||
sendButton(POWER);
|
||||
}
|
||||
if (currentLine.endsWith("GET /play")) {
|
||||
//Serial.println("MD play");
|
||||
//Serial.flush();
|
||||
//IrSender.sendSony(0xF, PLAY, 2, 12);
|
||||
sendButton(PLAY);
|
||||
}
|
||||
if (currentLine.endsWith("GET /pause")) {
|
||||
sendButton(PAUSE);
|
||||
}
|
||||
if (currentLine.endsWith("GET /stop")) {
|
||||
sendButton(STOP);
|
||||
}
|
||||
if (currentLine.endsWith("GET /prev")) {
|
||||
sendButton(PREV);
|
||||
}
|
||||
if (currentLine.endsWith("GET /next")) {
|
||||
sendButton(NEXT);
|
||||
}
|
||||
if (currentLine.endsWith("POST /api/control-deck")) {
|
||||
|
||||
Serial.println("POST");
|
||||
|
||||
Reference in New Issue
Block a user