Web Remote Control A/C with Arduino and ethernet card W5100 without sd card #include #include #define maxLength 300 String inString = String(maxLength); // allocate a new String const byte IR_PIN4=4;//Ir led pin const byte LEDpin=8;//Indicator byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED}; byte ip[] = {192,168,1,15};//Put your free ip for your local network and setup modem... const byte Port = 80;//Setup your modem. Enable port 80 listen your ip Server server(Port); char c,cMstRCmnd='/'; word xClicksProcessed=0; char codeOK='0';//start Code is blank.... void setup() { // start the Ethernet connection and the server: Ethernet.begin(mac, ip); server.begin(); Serial.begin(9600);//Restore, if you want to monitor program's //operation via serial monitor pinMode(IR_PIN4,OUTPUT); digitalWrite(IR_PIN4,LOW); pinMode(LEDpin,OUTPUT); LEDOff(); } void loop() {//1 Client client = server.available(); if (client) {//2 boolean currentLineIsBlank = true;//3 inString=0;//format inString while (client.connected()) {//4 if (client.available()) {//45 c = client.read();//6 if ((c!='\n') && (c!='\r')){ if (inString.length() < maxLength) { inString+=c; } } Serial.print(c); if (c == '\n' && currentLineIsBlank ) { delay(300); xClicksProcessed++; client.println("HTTP/1.1 200 OK");//8 client.println("Content-Type: text/html");//9 client.println();//10 client.println(""); client.println(""); client.print("Web Remote Control"); client.println(""); client.println(""); client.println(); client.println(""); client.println("
"); client.print("

Web Remote Control A/C with Arduino and W5100 ver.22/12/2011"); client.println("

"); //client.print("

See webgsmremotecontrol.webs.com

"); client.println("
"); client.println(); client.print("
Analog input A3 (Temperature) reads: "); client.print(analogRead(3)*0.488); client.println(""); client.println("
"); client.println(""); client.println(""); client.println("
"); client.println(); client.println("
");//to action isws na min xreiazete client.println(""); client.println("");//Ac on client.println("
"); client.println(); client.println("
"); client.println(""); client.println("");//Ac off client.println("
"); client.println(); client.println("
"); client.println(""); client.println(" "); client.println(""); client.println("
"); client.println(); client.println("
"); client.println(""); client.println(" "); client.println(""); client.println("
"); client.println(); client.println("
"); client.println(""); client.println(" "); client.println(""); client.println("
"); client.println(); client.print("

Clicks since server booted: "); client.print(xClicksProcessed); client.println("

"); client.println("
"); client.println("
"); break;//15 } if (c == '\n') {//17 currentLineIsBlank = true;//18 if (inString.indexOf("GET")>0) {//19 if (inString.indexOf("code=xxxx")>0) {//xxxx your code codeOK='1'; Serial.println("codeOK="); Serial.print(codeOK); } if (codeOK=='1'){ if (inString.indexOf("cmd=AC_ON")>0){ LEDOn(); SendACCodeOn(); Serial.println("codeOK="); Serial.print(codeOK); } if (inString.indexOf("cmd=AC_OFF")>0){ LEDOff(); SendACCodeOff(); } if (inString.indexOf("cmd=COOL")>0){ SendACCode_modeCool(); } if (inString.indexOf("cmd=HEAT")>0){ SendACCode_modeHeat(); } if (inString.indexOf("cmd=DRY")>0){ SendACCode_modeDry(); } if (inString.indexOf("cmd=Fan_Low")>0){ SendACCode_modeFanspeedLow(); } if (inString.indexOf("cmd=Fan_Medium")>0){ SendACCode_modeFanspeedMedium(); } if (inString.indexOf("cmd=Fan_High")>0){ SendACCode_modeFanspeedHigh(); } if (inString.indexOf("cmd=temp30")>0){ SendACCode_Temp_30(); } if (inString.indexOf("cmd=temp29")>0){ SendACCode_Temp_29(); } if (inString.indexOf("cmd=temp28")>0){ //SendACCode_Temp_28(); } if (inString.indexOf("cmd=temp27")>0){ SendACCode_Temp_27(); } if (inString.indexOf("cmd=temp26")>0){ SendACCode_Temp_26(); } if (inString.indexOf("cmd=temp25")>0){ SendACCode_Temp_25(); } if (inString.indexOf("cmd=temp24")>0){ SendACCode_Temp_24(); } if (inString.indexOf("cmd=temp23")>0){ SendACCode_Temp_23(); } if (inString.indexOf("cmd=temp22")>0){ //SendACCode_Temp_22(); } if (inString.indexOf("cmd=temp21")>0){ //SendACCode_Temp_21(); } if (inString.indexOf("cmd=temp20")>0){ //SendACCode_Temp_20(); } if (inString.indexOf("cmd=temp19")>0){ //SendACCode_Temp_29(); } if (inString.indexOf("cmd=temp18")>0){ //SendACCode_Temp_18(); } if (inString.indexOf("cmd=temp17")>0){ //SendACCode_Temp_17(); } if (inString.indexOf("cmd=temp16")>0){ //SendACCode_Temp_16(); } }//codeok }//get }//current line else if (c != '\r') { //20 currentLineIsBlank = false;//21 } }//client avalaible } delay(1);//25 client.stop();//26 }//27 }//28 void LEDOn(){ digitalWrite(LEDpin,HIGH); } void LEDOff(){ digitalWrite(LEDpin,LOW); } void pulseIR(long microsecs) { // we'll count down from the number of microseconds we are told to wait cli(); // this turns off any background interrupts while (microsecs > 0) { // 38 kHz is about 13 microseconds high and 13 microseconds low digitalWrite(IR_PIN4, HIGH); // this takes about 3 microseconds to happen delayMicroseconds(10); // hang out for 10 microseconds digitalWrite(IR_PIN4, LOW); // this also takes about 3 microseconds delayMicroseconds(10); // hang out for 10 microseconds // so 26 microseconds altogether microsecs -= 26; } sei(); // this turns them back on } void SendACCodeOn() { // This is the code for my particular Toyotomi on button pulseIR(9000); delayMicroseconds(4340); pulseIR(840); delayMicroseconds(320); pulseIR(740); delayMicroseconds(400); pulseIR(700); delayMicroseconds(1440); pulseIR(740); delayMicroseconds(1440); pulseIR(740); delayMicroseconds(1440); pulseIR(740); for(int x=0 ; x< 5 ; x++){ delayMicroseconds(360); pulseIR(740); } delayMicroseconds(1440); pulseIR(740); delayMicroseconds(1440); pulseIR(740); delayMicroseconds(1440); pulseIR(740); delayMicroseconds(400); pulseIR(700); delayMicroseconds(1440); pulseIR(740); delayMicroseconds(400); pulseIR(700); delayMicroseconds(1440); pulseIR(740); delayMicroseconds(1440); pulseIR(740); delayMicroseconds(340); pulseIR(760); for(int x=0 ; x< 4 ; x++){ delayMicroseconds(1440); pulseIR(740); } delayMicroseconds(340); pulseIR(760); for(int x=0 ; x< 3 ; x++){ delayMicroseconds(1440); pulseIR(740); } for(int x=0 ; x< 7 ; x++){ delayMicroseconds(360); pulseIR(740); } for(int x=0 ; x< 6 ; x++){ delayMicroseconds(1440); pulseIR(740); } for(int x=0 ; x< 6 ; x++){ delayMicroseconds(360); pulseIR(740); } for(int x=0 ; x< 6 ; x++){ delayMicroseconds(1440); pulseIR(740); } for(int x=0 ; x< 9 ; x++){ delayMicroseconds(360); pulseIR(740); } delayMicroseconds(1440); pulseIR(740); delayMicroseconds(360); pulseIR(740); delayMicroseconds(1440); pulseIR(740); delayMicroseconds(1440); pulseIR(740); delayMicroseconds(360); pulseIR(740); delayMicroseconds(1440); pulseIR(740); delayMicroseconds(360); pulseIR(500); } void SendACCodeOff() { // This is the code for Toyotomi off button pulseIR(9000); delayMicroseconds(4340); pulseIR(840); delayMicroseconds(320); pulseIR(740); delayMicroseconds(400); pulseIR(700); delayMicroseconds(1440); pulseIR(740); delayMicroseconds(380); pulseIR(740); delayMicroseconds(1440); pulseIR(740); for(int x=0 ; x< 5 ; x++){ delayMicroseconds(360); pulseIR(740); } delayMicroseconds(1440); pulseIR(740); delayMicroseconds(1440); pulseIR(740); delayMicroseconds(1440); pulseIR(740); delayMicroseconds(400); pulseIR(700); delayMicroseconds(400); pulseIR(700); delayMicroseconds(1440); pulseIR(740); delayMicroseconds(380); pulseIR(740); delayMicroseconds(360); pulseIR(760); delayMicroseconds(1440); pulseIR(740); delayMicroseconds(360); pulseIR(760); delayMicroseconds(360); pulseIR(760); delayMicroseconds(1440); pulseIR(740); delayMicroseconds(1440); pulseIR(740); for(int x=0 ; x< 4 ; x++){ delayMicroseconds(360); pulseIR(740); } delayMicroseconds(1440); pulseIR(740); for(int x=0 ; x< 6 ; x++){ delayMicroseconds(360); pulseIR(740); } for(int x=0 ; x< 6 ; x++){ delayMicroseconds(1440); pulseIR(740); } for(int x=0 ; x< 6 ; x++){ delayMicroseconds(360); pulseIR(740); } for(int x=0 ; x< 6 ; x++){ delayMicroseconds(1440); pulseIR(740); } for(int x=0 ; x< 9 ; x++){ delayMicroseconds(360); pulseIR(740); } delayMicroseconds(1440); pulseIR(740); delayMicroseconds(360); pulseIR(740); delayMicroseconds(1440); pulseIR(740); delayMicroseconds(1440); pulseIR(740); delayMicroseconds(360); pulseIR(740); delayMicroseconds(1440); pulseIR(740); delayMicroseconds(360); pulseIR(740); } //Pulse Auto mode Toyotomi A/C void SendACCode_modeAuto() { pulseIR(9000); delayMicroseconds(4400); pulseIR(740); for(int x=0 ; x< 3 ; x++){ delayMicroseconds(380); pulseIR(700); } delayMicroseconds(1440); pulseIR(740); for(int x=0 ; x< 4 ; x++){ delayMicroseconds(380); pulseIR(700); } delayMicroseconds(1440); pulseIR(740); for(int x=0 ; x< 2 ; x++){ delayMicroseconds(380); pulseIR(700); } delayMicroseconds(1440); pulseIR(740); for(int x=0 ; x< 2 ; x++){ delayMicroseconds(380); pulseIR(700); } delayMicroseconds(1440); pulseIR(740); for(int x=0 ; x< 3 ; x++){ delayMicroseconds(380); pulseIR(700); } for(int x=0 ; x< 2 ; x++){ delayMicroseconds(1440); pulseIR(700); } delayMicroseconds(380); pulseIR(700); for(int x=0 ; x< 2 ; x++){ delayMicroseconds(1440); pulseIR(700); } delayMicroseconds(380); pulseIR(700); delayMicroseconds(1440); pulseIR(700); for(int x=0 ; x< 9 ; x++){ delayMicroseconds(380); pulseIR(700); } for(int x=0 ; x< 6 ; x++){ delayMicroseconds(1440); pulseIR(700); } for(int x=0 ; x< 6 ; x++){ delayMicroseconds(380); pulseIR(700); } for(int x=0 ; x< 6 ; x++){ delayMicroseconds(1440); pulseIR(700); } for(int x=0 ; x< 9 ; x++){ delayMicroseconds(380); pulseIR(700); } delayMicroseconds(1440); pulseIR(740); delayMicroseconds(380); pulseIR(740); for(int x=0 ; x< 2 ; x++){ delayMicroseconds(1440); pulseIR(700); } delayMicroseconds(380); pulseIR(740); delayMicroseconds(1440); pulseIR(740); delayMicroseconds(380); pulseIR(740); } //Pulse Cool mode Toyotomi A/C void SendACCode_modeCool() { pulseIR(9000); delayMicroseconds(4400); pulseIR(740); delayMicroseconds(1440); pulseIR(740); for(int x=0 ; x< 2 ; x++){ delayMicroseconds(380); pulseIR(700); } for(int x=0 ; x< 2 ; x++){ delayMicroseconds(1440); pulseIR(700); } for(int x=0 ; x< 4 ; x++){ delayMicroseconds(380); pulseIR(700); } delayMicroseconds(1440); pulseIR(740); delayMicroseconds(380); pulseIR(700); delayMicroseconds(1440); pulseIR(740); for(int x=0 ; x< 3 ; x++){ delayMicroseconds(380); pulseIR(700); } for(int x=0 ; x< 3 ; x++){ delayMicroseconds(1440); pulseIR(700); } for(int x=0 ; x< 4 ; x++){ delayMicroseconds(380); pulseIR(700); } delayMicroseconds(1440); pulseIR(700); for(int x=0 ; x< 2 ; x++){ delayMicroseconds(380); pulseIR(700); } delayMicroseconds(1440); pulseIR(700); for(int x=0 ; x< 8 ; x++){ delayMicroseconds(380); pulseIR(700); } for(int x=0 ; x< 6 ; x++){ delayMicroseconds(1440); pulseIR(700); } for(int x=0 ; x< 6 ; x++){ delayMicroseconds(380); pulseIR(700); } for(int x=0 ; x< 6 ; x++){ delayMicroseconds(1440); pulseIR(700); } for(int x=0 ; x< 9 ; x++){ delayMicroseconds(380); pulseIR(700); } delayMicroseconds(1440); pulseIR(700); delayMicroseconds(380); pulseIR(700); delayMicroseconds(1440); pulseIR(700); delayMicroseconds(1440); pulseIR(700); delayMicroseconds(380); pulseIR(700); delayMicroseconds(1440); pulseIR(700); delayMicroseconds(380); pulseIR(700); } //Pulse Dry mode Toyotomi A/C void SendACCode_modeDry() { pulseIR(9000); delayMicroseconds(4400); pulseIR(740); delayMicroseconds(380); pulseIR(700); delayMicroseconds(1440); pulseIR(700); delayMicroseconds(380); pulseIR(700); for(int x=0 ; x< 3 ; x++){ delayMicroseconds(1440); pulseIR(700); } for(int x=0 ; x< 3 ; x++){ delayMicroseconds(380); pulseIR(700); } for(int x=0 ; x< 3 ; x++){ delayMicroseconds(1440); pulseIR(700); } delayMicroseconds(380); pulseIR(700); delayMicroseconds(1440); pulseIR(700); delayMicroseconds(380); pulseIR(700); for(int x=0 ; x< 5 ; x++){ delayMicroseconds(1440); pulseIR(700); } for(int x=0 ; x< 2 ; x++){ delayMicroseconds(380); pulseIR(700); } delayMicroseconds(1440); pulseIR(700); for(int x=0 ; x< 2 ; x++){ delayMicroseconds(380); pulseIR(700); } delayMicroseconds(1440); pulseIR(700); for(int x=0 ; x< 8 ; x++){ delayMicroseconds(380); pulseIR(700); } for(int x=0 ; x< 6 ; x++){ delayMicroseconds(1440); pulseIR(700); } for(int x=0 ; x< 6 ; x++){ delayMicroseconds(380); pulseIR(700); } for(int x=0 ; x< 6 ; x++){ delayMicroseconds(1440); pulseIR(700); } for(int x=0 ; x< 9 ; x++){ delayMicroseconds(380); pulseIR(700); } delayMicroseconds(1440); pulseIR(700); delayMicroseconds(380); pulseIR(700); delayMicroseconds(1440); pulseIR(700); delayMicroseconds(1440); pulseIR(700); delayMicroseconds(380); pulseIR(700); delayMicroseconds(1440); pulseIR(700); delayMicroseconds(380); pulseIR(700); } //Pulse Fan mode Toyotomi A/C void SendACCode_modeFan() { pulseIR(9000); delayMicroseconds(4400); pulseIR(740); delayMicroseconds(1440); pulseIR(700); delayMicroseconds(1440); pulseIR(700); delayMicroseconds(380); pulseIR(700); delayMicroseconds(1440); pulseIR(700); for(int x=0 ; x< 4 ; x++){ delayMicroseconds(380); pulseIR(700); } delayMicroseconds(1440); pulseIR(700); for(int x=0 ; x< 2 ; x++){ delayMicroseconds(380); pulseIR(700); } for(int x=0 ; x< 2 ; x++){ delayMicroseconds(1440); pulseIR(700); } delayMicroseconds(380); pulseIR(700); delayMicroseconds(1440); pulseIR(700); delayMicroseconds(380); pulseIR(700); delayMicroseconds(1440); pulseIR(700); delayMicroseconds(380); pulseIR(700); for(int x=0 ; x< 3 ; x++){ delayMicroseconds(1440); pulseIR(700); } delayMicroseconds(380); pulseIR(700); delayMicroseconds(1440); pulseIR(700); for(int x=0 ; x< 2 ; x++){ delayMicroseconds(380); pulseIR(700); } delayMicroseconds(1440); pulseIR(700); for(int x=0 ; x< 8 ; x++){ delayMicroseconds(380); pulseIR(700); } for(int x=0 ; x< 6 ; x++){ delayMicroseconds(1440); pulseIR(700); } for(int x=0 ; x< 6 ; x++){ delayMicroseconds(380); pulseIR(700); } for(int x=0 ; x< 6 ; x++){ delayMicroseconds(1440); pulseIR(700); } for(int x=0 ; x< 9 ; x++){ delayMicroseconds(380); pulseIR(700); } delayMicroseconds(1440); pulseIR(700); delayMicroseconds(380); pulseIR(700); delayMicroseconds(1440); pulseIR(700); delayMicroseconds(1440); pulseIR(700); delayMicroseconds(380); pulseIR(700); delayMicroseconds(1440); pulseIR(700); } void SendACCode_modeHeat() { // This is the code for Toyotomi mode Heat button pulseIR(9000); delayMicroseconds(4380); pulseIR(800); for(int x=0 ; x< 2 ; x++){ delayMicroseconds(360); pulseIR(740); } for(int x=0 ; x< 3 ; x++){ delayMicroseconds(1440); pulseIR(740); } for(int x=0 ; x< 4 ; x++){ delayMicroseconds(360); pulseIR(740); } for(int x=0 ; x< 5 ; x++){ delayMicroseconds(1440); pulseIR(740); } delayMicroseconds(360); pulseIR(740); delayMicroseconds(1440); pulseIR(740); for(int x=0 ; x< 3 ; x++){ delayMicroseconds(360); pulseIR(740); } delayMicroseconds(1440); pulseIR(740); delayMicroseconds(380); pulseIR(740); for(int x=0 ; x< 2 ; x++){ delayMicroseconds(1440); pulseIR(740); } for(int x=0 ; x< 2 ; x++){ delayMicroseconds(380); pulseIR(740); } delayMicroseconds(1440); pulseIR(740); for(int x=0 ; x< 8 ; x++){ delayMicroseconds(360); pulseIR(740); } for(int x=0 ; x< 6 ; x++){ delayMicroseconds(1440); pulseIR(740); } for(int x=0 ; x< 6 ; x++){ delayMicroseconds(380); pulseIR(740); } for(int x=0 ; x< 6 ; x++){ delayMicroseconds(1440); pulseIR(740); } for(int x=0 ; x< 9 ; x++){ delayMicroseconds(380); pulseIR(740); } delayMicroseconds(1440); pulseIR(740); delayMicroseconds(380); pulseIR(740); for(int x=0 ; x< 2 ; x++){ delayMicroseconds(1440); pulseIR(740); } delayMicroseconds(380); pulseIR(740); delayMicroseconds(1440); pulseIR(740); delayMicroseconds(380); pulseIR(740); } void SendACCode_modeFanspeedAuto() { // This is the code for Toyotomi fan speed Auto button pulseIR(9000); delayMicroseconds(4380); pulseIR(800); for(int x=0 ; x< 2 ; x++){ delayMicroseconds(380); pulseIR(740); } for(int x=0 ; x< 2 ; x++){ delayMicroseconds(1440); pulseIR(740); } for(int x=0 ; x< 5 ; x++){ delayMicroseconds(380); pulseIR(740); } for(int x=0 ; x< 3 ; x++){ delayMicroseconds(1440); pulseIR(740); } for(int x=0 ; x< 3 ; x++){ delayMicroseconds(380); pulseIR(740); } for(int x=0 ; x< 2 ; x++){ delayMicroseconds(1440); pulseIR(740); } for(int x=0 ; x< 5 ; x++){ delayMicroseconds(380); pulseIR(740); } delayMicroseconds(1440); pulseIR(740); delayMicroseconds(380); pulseIR(740); for(int x=0 ; x< 2 ; x++){ delayMicroseconds(1440); pulseIR(740); } for(int x=0 ; x< 8 ; x++){ delayMicroseconds(380); pulseIR(740); } for(int x=0 ; x< 6 ; x++){ delayMicroseconds(1440); pulseIR(740); } for(int x=0 ; x< 6 ; x++){ delayMicroseconds(380); pulseIR(740); } for(int x=0 ; x< 6 ; x++){ delayMicroseconds(1440); pulseIR(740); } for(int x=0 ; x< 9 ; x++){ delayMicroseconds(380); pulseIR(740); } delayMicroseconds(1440); pulseIR(740); delayMicroseconds(380); pulseIR(740); delayMicroseconds(1440); pulseIR(740); delayMicroseconds(1440); pulseIR(740); delayMicroseconds(380); pulseIR(740); delayMicroseconds(1440); pulseIR(740); delayMicroseconds(380); pulseIR(740); } void SendACCode_modeFanspeedLow() { // This is the code for Toyotomi fan speed LOW button pulseIR(9000); delayMicroseconds(4380); pulseIR(800); for(int x=0 ; x< 2 ; x++){ delayMicroseconds(380); pulseIR(740); } for(int x=0 ; x< 3 ; x++){ delayMicroseconds(1440); pulseIR(740); } for(int x=0 ; x< 4 ; x++){ delayMicroseconds(380); pulseIR(740); } for(int x=0 ; x< 3 ; x++){ delayMicroseconds(1440); pulseIR(740); } for(int x=0 ; x< 4 ; x++){ delayMicroseconds(380); pulseIR(740); } for(int x=0 ; x< 2 ; x++){ delayMicroseconds(1440); pulseIR(740); } for(int x=0 ; x< 4 ; x++){ delayMicroseconds(380); pulseIR(740); } delayMicroseconds(1440); pulseIR(740); delayMicroseconds(380); pulseIR(740); for(int x=0 ; x< 2 ; x++){ delayMicroseconds(1440); pulseIR(740); } for(int x=0 ; x< 8 ; x++){ delayMicroseconds(380); pulseIR(740); } for(int x=0 ; x< 6 ; x++){ delayMicroseconds(1440); pulseIR(740); } for(int x=0 ; x< 6 ; x++){ delayMicroseconds(380); pulseIR(740); } for(int x=0 ; x< 6 ; x++){ delayMicroseconds(1440); pulseIR(740); } for(int x=0 ; x< 9 ; x++){ delayMicroseconds(380); pulseIR(740); } delayMicroseconds(1440); pulseIR(740); delayMicroseconds(380); pulseIR(740); delayMicroseconds(1440); pulseIR(740); delayMicroseconds(1440); pulseIR(740); delayMicroseconds(380); pulseIR(740); delayMicroseconds(1440); pulseIR(740); delayMicroseconds(380); pulseIR(740); } void SendACCode_modeFanspeedMedium() { // This is the code for Toyotomi fan spped medium button pulseIR(9000); delayMicroseconds(4380); pulseIR(800); for(int x=0 ; x< 2 ; x++){ delayMicroseconds(380); pulseIR(740); } for(int x=0 ; x< 2 ; x++){ delayMicroseconds(1440); pulseIR(740); } delayMicroseconds(380); pulseIR(740); delayMicroseconds(1440); pulseIR(740); for(int x=0 ; x< 3 ; x++){ delayMicroseconds(380); pulseIR(740); } for(int x=0 ; x< 4 ; x++){ delayMicroseconds(1440); pulseIR(740); } delayMicroseconds(380); pulseIR(740); for(int x=0 ; x< 2 ; x++){ delayMicroseconds(1440); pulseIR(740); } delayMicroseconds(380); pulseIR(740); delayMicroseconds(1440); pulseIR(740); for(int x=0 ; x< 2 ; x++){ delayMicroseconds(380); pulseIR(740); } for(int x=0 ; x< 3 ; x++){ delayMicroseconds(1440); pulseIR(740); } for(int x=0 ; x< 2 ; x++){ delayMicroseconds(380); pulseIR(740); } delayMicroseconds(1440); pulseIR(740); for(int x=0 ; x< 8 ; x++){ delayMicroseconds(380); pulseIR(740); } for(int x=0 ; x< 6 ; x++){ delayMicroseconds(1440); pulseIR(740); } for(int x=0 ; x< 6 ; x++){ delayMicroseconds(380); pulseIR(740); } for(int x=0 ; x< 6 ; x++){ delayMicroseconds(1440); pulseIR(740); } for(int x=0 ; x< 9 ; x++){ delayMicroseconds(380); pulseIR(740); } delayMicroseconds(1440); pulseIR(740); delayMicroseconds(380); pulseIR(740); delayMicroseconds(1440); pulseIR(740); delayMicroseconds(1440); pulseIR(740); delayMicroseconds(380); pulseIR(740); delayMicroseconds(1440); pulseIR(740); delayMicroseconds(380); pulseIR(740); } void SendACCode_modeFanspeedHigh() { // This is the code for Toyotomi fan speed High button pulseIR(9000); delayMicroseconds(4380); pulseIR(800); delayMicroseconds(380); pulseIR(740); delayMicroseconds(380); pulseIR(740); for(int x=0 ; x< 4 ; x++){ delayMicroseconds(1440); pulseIR(740); } for(int x=0 ; x< 3 ; x++){ delayMicroseconds(380); pulseIR(740); } for(int x=0 ; x< 3 ; x++){ delayMicroseconds(1440); pulseIR(740); } for(int x=0 ; x< 10 ; x++){ delayMicroseconds(380); pulseIR(740); } delayMicroseconds(1440); pulseIR(740); delayMicroseconds(380); pulseIR(740); delayMicroseconds(1440); pulseIR(740); delayMicroseconds(1440); pulseIR(740); for(int x=0 ; x< 8 ; x++){ delayMicroseconds(380); pulseIR(740); } for(int x=0 ; x< 6 ; x++){ delayMicroseconds(1440); pulseIR(740); } for(int x=0 ; x< 6 ; x++){ delayMicroseconds(380); pulseIR(740); } for(int x=0 ; x< 6 ; x++){ delayMicroseconds(1440); pulseIR(740); } for(int x=0 ; x< 9 ; x++){ delayMicroseconds(380); pulseIR(740); } delayMicroseconds(1440); pulseIR(740); delayMicroseconds(380); pulseIR(740); delayMicroseconds(1440); pulseIR(740); delayMicroseconds(1440); pulseIR(740); delayMicroseconds(380); pulseIR(740); delayMicroseconds(1440); pulseIR(740); delayMicroseconds(380); pulseIR(740); } void SendACCode_Temp_30() { // This is the code for Toyotomi temp30 pulseIR(9000); delayMicroseconds(4380); pulseIR(800); for(int x=0 ; x< 2 ; x++){ delayMicroseconds(380); pulseIR(740); } for(int x=0 ; x< 3 ; x++){ delayMicroseconds(1440); pulseIR(740); } for(int x=0 ; x< 4 ; x++){ delayMicroseconds(380); pulseIR(740); } for(int x=0 ; x< 4 ; x++){ delayMicroseconds(1440); pulseIR(740); } delayMicroseconds(380); pulseIR(740); for(int x=0 ; x< 2 ; x++){ delayMicroseconds(1440); pulseIR(740); } for(int x=0 ; x< 2 ; x++){ delayMicroseconds(380); pulseIR(740); } delayMicroseconds(1440); pulseIR(740); for(int x=0 ; x< 3 ; x++){ delayMicroseconds(380); pulseIR(740); } delayMicroseconds(1440); pulseIR(740); delayMicroseconds(380); pulseIR(740); for(int x=0 ; x< 2 ; x++){ delayMicroseconds(1440); pulseIR(740); } for(int x=0 ; x< 8 ; x++){ delayMicroseconds(380); pulseIR(740); } for(int x=0 ; x< 6 ; x++){ delayMicroseconds(1440); pulseIR(740); } for(int x=0 ; x< 6 ; x++){ delayMicroseconds(380); pulseIR(740); } for(int x=0 ; x< 6 ; x++){ delayMicroseconds(1440); pulseIR(740); } for(int x=0 ; x< 9 ; x++){ delayMicroseconds(380); pulseIR(740); } delayMicroseconds(1440); pulseIR(740); delayMicroseconds(380); pulseIR(740); delayMicroseconds(1440); pulseIR(740); delayMicroseconds(1440); pulseIR(740); delayMicroseconds(380); pulseIR(740); delayMicroseconds(1440); pulseIR(740); delayMicroseconds(380); pulseIR(740); } void SendACCode_Temp_29() { // This is the code for Toyotomi Temp29 pulseIR(9000); delayMicroseconds(4380); pulseIR(800); for(int x=0 ; x< 2 ; x++){ delayMicroseconds(380); pulseIR(740); } for(int x=0 ; x< 3 ; x++){ delayMicroseconds(1440); pulseIR(740); } for(int x=0 ; x< 3 ; x++){ delayMicroseconds(380); pulseIR(740); } delayMicroseconds(1440); pulseIR(740); delayMicroseconds(380); pulseIR(740); for(int x=0 ; x< 2 ; x++){ delayMicroseconds(1440); pulseIR(740); } for(int x=0 ; x< 2 ; x++){ delayMicroseconds(380); pulseIR(740); } for(int x=0 ; x< 3 ; x++){ delayMicroseconds(1440); pulseIR(740); } delayMicroseconds(380); pulseIR(740); delayMicroseconds(1440); pulseIR(740); for(int x=0 ; x< 3 ; x++){ delayMicroseconds(380); pulseIR(740); } delayMicroseconds(1440); pulseIR(740); delayMicroseconds(380); pulseIR(740); for(int x=0 ; x< 2 ; x++){ delayMicroseconds(1440); pulseIR(740); } for(int x=0 ; x< 8 ; x++){ delayMicroseconds(380); pulseIR(740); } for(int x=0 ; x< 6 ; x++){ delayMicroseconds(1440); pulseIR(740); } for(int x=0 ; x< 6 ; x++){ delayMicroseconds(380); pulseIR(740); } for(int x=0 ; x< 6 ; x++){ delayMicroseconds(1440); pulseIR(740); } for(int x=0 ; x< 9 ; x++){ delayMicroseconds(380); pulseIR(740); } delayMicroseconds(1440); pulseIR(740); delayMicroseconds(380); pulseIR(740); delayMicroseconds(1440); pulseIR(740); delayMicroseconds(1440); pulseIR(740); delayMicroseconds(380); pulseIR(740); delayMicroseconds(1440); pulseIR(740); delayMicroseconds(380); pulseIR(740); } void SendAC_Temp_27() { // This is the code for Toyotomi TEMP27 button pulseIR(9000); delayMicroseconds(4340); pulseIR(760); for(int x=0 ; x< 2 ; x++){ delayMicroseconds(400); pulseIR(700); } for(int x=0 ; x< 3 ; x++){ delayMicroseconds(1500); pulseIR(700); } for(int x=0 ; x< 3 ; x++){ delayMicroseconds(400); pulseIR(700); } for(int x=0 ; x< 2 ; x++){ delayMicroseconds(1500); pulseIR(700); } delayMicroseconds(400); pulseIR(700); for(int x=0 ; x< 2 ; x++){ delayMicroseconds(1500); pulseIR(700); } delayMicroseconds(400); pulseIR(700); for(int x=0 ; x< 2 ; x++){ delayMicroseconds(1500); pulseIR(700); } delayMicroseconds(400); pulseIR(700); delayMicroseconds(1500); pulseIR(700); delayMicroseconds(400); pulseIR(700); for(int x=0 ; x< 2 ; x++){ delayMicroseconds(1500); pulseIR(700); } delayMicroseconds(400); pulseIR(700); delayMicroseconds(1500); pulseIR(700); for(int x=0 ; x< 3 ; x++){ delayMicroseconds(400); pulseIR(700); } delayMicroseconds(1500); pulseIR(700); for(int x=0 ; x< 7 ; x++){ delayMicroseconds(400); pulseIR(700); } for(int x=0 ; x< 6 ; x++){ delayMicroseconds(1500); pulseIR(700); } for(int x=0 ; x< 6 ; x++){ delayMicroseconds(400); pulseIR(700); } for(int x=0 ; x< 6 ; x++){ delayMicroseconds(1500); pulseIR(700); } for(int x=0 ; x< 9 ; x++){ delayMicroseconds(400); pulseIR(700); } delayMicroseconds(1500); pulseIR(700); delayMicroseconds(400); pulseIR(700); for(int x=0 ; x< 2 ; x++){ delayMicroseconds(1500); pulseIR(700); } delayMicroseconds(400); pulseIR(700); delayMicroseconds(1500); pulseIR(700); delayMicroseconds(400); pulseIR(700); } void SendAC_Temp_26() { // This is the code for Toyotomi TEMP26 button pulseIR(9000); delayMicroseconds(4340); pulseIR(760); for(int x=0 ; x< 2 ; x++){ delayMicroseconds(400); pulseIR(700); } for(int x=0 ; x< 3 ; x++){ delayMicroseconds(1500); pulseIR(700); } for(int x=0 ; x< 4 ; x++){ delayMicroseconds(400); pulseIR(700); } for(int x=0 ; x< 1 ; x++){ delayMicroseconds(1500); pulseIR(700); } delayMicroseconds(400); pulseIR(700); for(int x=0 ; x< 3 ; x++){ delayMicroseconds(1500); pulseIR(700); } delayMicroseconds(400); pulseIR(700); for(int x=0 ; x< 3 ; x++){ delayMicroseconds(1500); pulseIR(700); } delayMicroseconds(400); pulseIR(700); for(int x=0 ; x< 2 ; x++){ delayMicroseconds(1500); pulseIR(700); } delayMicroseconds(400); pulseIR(700); delayMicroseconds(1500); pulseIR(700); for(int x=0 ; x< 3 ; x++){ delayMicroseconds(400); pulseIR(700); } delayMicroseconds(1500); pulseIR(700); for(int x=0 ; x< 7 ; x++){ delayMicroseconds(400); pulseIR(700); } for(int x=0 ; x< 6 ; x++){ delayMicroseconds(1500); pulseIR(700); } for(int x=0 ; x< 6 ; x++){ delayMicroseconds(400); pulseIR(700); } for(int x=0 ; x< 6 ; x++){ delayMicroseconds(1500); pulseIR(700); } for(int x=0 ; x< 9 ; x++){ delayMicroseconds(400); pulseIR(700); } delayMicroseconds(1500); pulseIR(700); delayMicroseconds(400); pulseIR(700); delayMicroseconds(1500); pulseIR(700); delayMicroseconds(1500); pulseIR(700); delayMicroseconds(400); pulseIR(700); delayMicroseconds(1500); pulseIR(700); delayMicroseconds(400); pulseIR(700); } void SendAC_Temp_25() { // This is the code for Toyotomi TEMP25 button pulseIR(9000); delayMicroseconds(4400); pulseIR(760); for(int x=0 ; x< 2 ; x++){ delayMicroseconds(400); pulseIR(700); } for(int x=0 ; x< 3 ; x++){ delayMicroseconds(1500); pulseIR(700); } for(int x=0 ; x< 3 ; x++){ delayMicroseconds(400); pulseIR(700); } delayMicroseconds(1500); pulseIR(700); for(int x=0 ; x< 2 ; x++){ delayMicroseconds(400); pulseIR(700); } for(int x=0 ; x< 2 ; x++){ delayMicroseconds(1500); pulseIR(700); } delayMicroseconds(400); pulseIR(700); for(int x=0 ; x< 2 ; x++){ delayMicroseconds(1500); pulseIR(700); } for(int x=0 ; x< 2 ; x++){ delayMicroseconds(400); pulseIR(700); } for(int x=0 ; x< 3 ; x++){ delayMicroseconds(1500); pulseIR(700); } delayMicroseconds(400); pulseIR(700); delayMicroseconds(1500); pulseIR(700); for(int x=0 ; x< 3 ; x++){ delayMicroseconds(400); pulseIR(700); } delayMicroseconds(1500); pulseIR(700); for(int x=0 ; x< 7 ; x++){ delayMicroseconds(400); pulseIR(700); } for(int x=0 ; x< 6 ; x++){ delayMicroseconds(1500); pulseIR(700); } for(int x=0 ; x< 6 ; x++){ delayMicroseconds(400); pulseIR(700); } for(int x=0 ; x< 6 ; x++){ delayMicroseconds(1500); pulseIR(700); } for(int x=0 ; x< 9 ; x++){ delayMicroseconds(400); pulseIR(700); } delayMicroseconds(1500); pulseIR(700); delayMicroseconds(400); pulseIR(700); delayMicroseconds(1500); pulseIR(700); delayMicroseconds(1500); pulseIR(700); delayMicroseconds(400); pulseIR(700); delayMicroseconds(1500); pulseIR(700); delayMicroseconds(400); pulseIR(700); } void SendAC_Temp_24() { // This is the code for Toyotomi TEMP24 button pulseIR(9000); delayMicroseconds(4400); pulseIR(760); for(int x=0 ; x< 2 ; x++){ delayMicroseconds(400); pulseIR(700); } for(int x=0 ; x< 3 ; x++){ delayMicroseconds(1500); pulseIR(700); } for(int x=0 ; x< 6 ; x++){ delayMicroseconds(400); pulseIR(700); } delayMicroseconds(1500); pulseIR(700); for(int x=0 ; x< 3 ; x++){ delayMicroseconds(400); pulseIR(700); } for(int x=0 ; x< 2 ; x++){ delayMicroseconds(1500); pulseIR(700); } for(int x=0 ; x< 4 ; x++){ delayMicroseconds(400); pulseIR(700); } for(int x=0 ; x< 2 ; x++){ delayMicroseconds(1500); pulseIR(700); } for(int x=0 ; x< 3 ; x++){ delayMicroseconds(400); pulseIR(700); } delayMicroseconds(1500); pulseIR(700); for(int x=0 ; x< 7 ; x++){ delayMicroseconds(400); pulseIR(700); } for(int x=0 ; x< 6 ; x++){ delayMicroseconds(1500); pulseIR(700); } for(int x=0 ; x< 6 ; x++){ delayMicroseconds(400); pulseIR(700); } for(int x=0 ; x< 6 ; x++){ delayMicroseconds(1500); pulseIR(700); } for(int x=0 ; x< 9 ; x++){ delayMicroseconds(400); pulseIR(700); } delayMicroseconds(1500); pulseIR(700); delayMicroseconds(400); pulseIR(700); delayMicroseconds(1500); pulseIR(700); delayMicroseconds(1500); pulseIR(700); delayMicroseconds(400); pulseIR(700); delayMicroseconds(1500); pulseIR(700); delayMicroseconds(400); pulseIR(700); } void SendAC_Temp_23() { // This is the code for Toyotomi TEMP23 button pulseIR(9000); delayMicroseconds(4400); pulseIR(760); for(int x=0 ; x< 2 ; x++){ delayMicroseconds(400); pulseIR(700); } for(int x=0 ; x< 3 ; x++){ delayMicroseconds(1500); pulseIR(700); } for(int x=0 ; x< 3 ; x++){ delayMicroseconds(400); pulseIR(700); } for(int x=0 ; x< 3 ; x++){ delayMicroseconds(1500); pulseIR(700); } for(int x=0 ; x< 2 ; x++){ delayMicroseconds(400); pulseIR(700); } for(int x=0 ; x< 2 ; x++){ delayMicroseconds(1500); pulseIR(700); } for(int x=0 ; x< 2 ; x++){ delayMicroseconds(400); pulseIR(700); } delayMicroseconds(1500); pulseIR(700); for(int x=0 ; x< 2 ; x++){ delayMicroseconds(400); pulseIR(700); } for(int x=0 ; x< 2 ; x++){ delayMicroseconds(1500); pulseIR(700); } for(int x=0 ; x< 3 ; x++){ delayMicroseconds(400); pulseIR(700); } delayMicroseconds(1500); pulseIR(700); for(int x=0 ; x< 7 ; x++){ delayMicroseconds(400); pulseIR(700); } for(int x=0 ; x< 6 ; x++){ delayMicroseconds(1500); pulseIR(700); } for(int x=0 ; x< 6 ; x++){ delayMicroseconds(400); pulseIR(700); } for(int x=0 ; x< 6 ; x++){ delayMicroseconds(1500); pulseIR(700); } for(int x=0 ; x< 9 ; x++){ delayMicroseconds(400); pulseIR(700); } delayMicroseconds(1500); pulseIR(700); delayMicroseconds(400); pulseIR(700); delayMicroseconds(1500); pulseIR(700); delayMicroseconds(1500); pulseIR(700); delayMicroseconds(400); pulseIR(700); delayMicroseconds(1500); pulseIR(700); delayMicroseconds(400); pulseIR(700); }