/* Codigos control remoto SAMSUNG Baja Vol irsend.sendSAMSUNG(0xE0E0D02F, 32) Sube Vol 0xE0E0E01F Mute 0xE0E0F00F Canal 1 0xE0E020DF Canal 2 0xE0E0A05F Canal 3 0xE0E0609F Canal 4 0xE0E010EF Canal 5 0xE0E0906F Canal 6 0xE0E050AF Canal 7 0xE0E030CF Canal 8 0xE0E0B04F Canal 9 0xE0E0708F Canal 0 0xE0E08877 Sube Canal 0xE0E048B7 Baja Canal 0xE0E008F7 ON/OFF 0xE0E040BF Canal Pre 0xE0E0C837 Lista canal 0xE0E0D629 Cursor Up 0xE0E006F9 Cursor Down 0xE0E08679 Cursor Right0xE0E046B9 Cursor Left 0xE0E0A659 ENTER 0xE0E016E9 Exit 0xE0E0B44B */ #include #include #include const char* ssid = "Jopapa"; const char* password = "miclave"; WiFiServer server(80); IRsend irsend(4); // An IR LED is controlled by GPIO pin 4 (D2) void setup() { Serial.begin(115200); irsend.begin(); delay(10); IPAddress ip(192, 168, 1, 71); IPAddress gateway(192,168,1,1); IPAddress subnet (255,255,255,0); WiFi.begin(ssid, password); // Connect to WiFi network WiFi.config(ip,gateway,subnet); while (WiFi.status() != WL_CONNECTED) { delay(500);Serial.print(".");} server.begin(); } void loop() { // Check if a client has connected WiFiClient client = server.available(); if (!client) {return;} // Wait until the client sends some data // Serial.println("new client"); // while(!client.available()){ // delay(1); // } // Read the first line of the request String request = client.readStringUntil('\r'); Serial.println(request); client.flush(); // Match the request if (request.indexOf("/codeO") != -1) { //on/off irsend.sendSAMSUNG(0xE0E040BF, 32); } if (request.indexOf("/codeb") != -1) { //baja vol irsend.sendSAMSUNG(0xE0E0D02F, 32); } if (request.indexOf("/codes") != -1) { //sube Vol irsend.sendSAMSUNG(0xE0E0E01F, 32); } if (request.indexOf("/codem") != -1) { //mute irsend.sendSAMSUNG(0xE0E0F00F, 32); } if (request.indexOf("/code1") != -1) { //on/off irsend.sendSAMSUNG(0xE0E020DF, 32); } if (request.indexOf("/code2") != -1) { //baja vol irsend.sendSAMSUNG(0xE0E0A05F, 32); } if (request.indexOf("/code3") != -1) { //sube Vol irsend.sendSAMSUNG(0xE0E0609F, 32); } if (request.indexOf("/code4") != -1) { //mute irsend.sendSAMSUNG(0xE0E010EF, 32); } // Return the response client.println("HTTP/1.1 200 OK"); client.println("Content-Type: text/html"); client.println(""); // do not forget this one client.println(""); client.println(""); client.println(""); client.println(""); client.println(""); client.println(""); client.println("

Control Remoto Samsung

"); client.println("
"); client.println(""); client.println("

"); client.println(""); client.println(""); client.println(""); client.println("
"); client.print("Canales"); client.println("
"); client.println(""); client.println(""); client.println(""); client.println("

"); client.println(""); client.println(""); client.println(""); delay(1); Serial.println("Client disonnected"); Serial.println(""); }