--- ir_sender.ino Sun Sep 22 00:50:32 2013 +++ ir_sender_apr9600.ino Sun Sep 22 00:52:44 2013 @@ -13,6 +13,8 @@ #define PREFIX_LENGTH 4 #define DELIMITER "." +#define APR9600 2 + // Enter a MAC address and IP address for your controller below. // The IP address will be dependent on your local network: byte mac[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; @@ -24,7 +26,12 @@ EthernetServer server(3000); void setup() { - // Open serial communications and wait for port to open: + // initialize the digital pin as an output. + pinMode(APR9600, OUTPUT); + // reset digital pin connected to APR9600: + digitalWrite(APR9600, HIGH); + + // Open serial communications and wait for port to open: Serial.begin(19200); @@ -55,6 +62,23 @@ // if GET request is getting favicon beginflag = false; } else + if (cusror == PREFIX_LENGTH + 1 && c == 's') { + // if GET request is requsting sound + beginflag = false; + digitalWrite(APR9600, LOW); + delay(500); + digitalWrite(APR9600, HIGH); + client.println("HTTP/1.1 200 OK"); + client.println("Content-Type: text/html"); + client.println("Connnection: close"); + client.println(); + client.println(""); + client.println(""); + client.println("sound"); + client.println(""); + client.println(""); + break; + } else if (cusror == BEGINNING_OF_LINE && c == '\r') { // if beggining of line is CR client.println("HTTP/1.1 200 OK");