diff --git a/IrSendRecv.ino b/IrSendRecv.ino index fc3c563..457bbf1 100644 --- a/IrSendRecv.ino +++ b/IrSendRecv.ino @@ -1,4 +1,3 @@ -#include #include #include #include @@ -12,7 +11,6 @@ WebServer server(80); const char webpage[] PROGMEM = R"rawliteral( - @@ -89,42 +87,6 @@ const char webpage[] PROGMEM = R"rawliteral( color: #fff; } - /* Input field styling */ - #channel-input input { - width: 100%; - max-width: 300px; - height: 50px; - font-size: 18px; - text-align: center; - border: none; - border-radius: var(--border-radius); - padding: 10px; - box-shadow: var(--box-shadow); - transition: box-shadow 0.3s ease; - } - - #channel-input input:focus { - outline: none; - box-shadow: 0px 4px 12px rgba(0, 123, 255, 0.4); - } - - /* Cross-browser compatibility for hiding spinner arrows */ - #channel-input input[type="number"] { - appearance: textfield; - /* Standard property */ - -webkit-appearance: none; - /* WebKit browsers (Chrome, Safari, Edge) */ - -moz-appearance: textfield; - /* Firefox */ - } - - /* Explicitly remove outer and inner spin buttons in WebKit browsers */ - #channel-input input[type="number"]::-webkit-outer-spin-button, - #channel-input input[type="number"]::-webkit-inner-spin-button { - -webkit-appearance: none; - margin: 0; - } - /* Numpad specific styles */ #numpad { display: flex; @@ -189,14 +151,8 @@ const char webpage[] PROGMEM = R"rawliteral( height: 60px; /* Keep a consistent height for the number 0 button */ } - - #channel-input input { - height: 40px; - font-size: 16px; - } } - - -
Power
@@ -217,7 +171,6 @@ const char webpage[] PROGMEM = R"rawliteral(
Mute
Source
-
Volume up
@@ -228,7 +181,6 @@ const char webpage[] PROGMEM = R"rawliteral(
Channel down
-
1
@@ -249,12 +201,14 @@ const char webpage[] PROGMEM = R"rawliteral(
0
- -
- +
+
// include the library +#include #define DELAY_AFTER_SEND 1000 #define DELAY_AFTER_LOOP 5000 @@ -274,17 +228,21 @@ unsigned long timeDelay = 5000; bool switching = false; void SendNecSignal(int buttonCode) { + digitalWrite(LED, HIGH); Serial.print(F("Send NEC with 8 bit address code: ")); Serial.println(buttonCode); Serial.flush(); IrSender.sendNEC(0x7F00, buttonCode, 1); delay(DELAY_AFTER_SEND); //delay must be greater than 5 ms (RECORD_GAP_MICROS), otherwise the receiver sees it as one long signal + digitalWrite(LED, LOW); } - void setup() { Serial.begin(115200); + pinMode(LED, OUTPUT); + digitalWrite(LED, HIGH); + WiFi.begin(ssid, password); Serial.println("connecting to wifi"); @@ -308,9 +266,6 @@ void setup() { Serial.print(F("Ready to receive IR signals of protocols: ")); printActiveIRProtocols(&Serial); - pinMode(LED, OUTPUT); - - // Define route for root server.on("/", HTTP_GET, []() { server.send(200, "text/html", webpage); @@ -344,6 +299,7 @@ void setup() { // Start the server server.begin(); + digitalWrite(LED, LOW); }