diff --git a/examples/LGACSendDemo/LGACSendDemo.ino b/examples/LGACSendDemo/LGACSendDemo.ino index 66d5025..da5db37 100644 --- a/examples/LGACSendDemo/LGACSendDemo.ino +++ b/examples/LGACSendDemo/LGACSendDemo.ino @@ -10,6 +10,11 @@ IRrecv irrecv (RECV_PIN); const int AC_TYPE = 0; // 0 : TOWER // 1 : WALL +// + +int AC_HEAT = 0; +// 0 : cooling +// 1 : heating int AC_POWER_ON = 0; // 0 : off @@ -27,6 +32,8 @@ int AC_FLOW = 1; // 1 : mid // 2 : high // if AC_TYPE =1, 3 : change +// + const int AC_FLOW_TOWER[3] = {0, 4, 6}; const int AC_FLOW_WALL[4] = {0, 2, 4, 5}; @@ -54,7 +61,14 @@ void ac_activate(int temperature, int air_flow) int AC_MSBITS1 = 8; int AC_MSBITS2 = 8; int AC_MSBITS3 = 0; - int AC_MSBITS4 = 0; + int AC_MSBITS4 ; + if ( AC_HEAT == 1 ) { + // heating + AC_MSBITS4 = 4; + } else { + // cooling + AC_MSBITS4 = 0; + } int AC_MSBITS5 = temperature - 15; int AC_MSBITS6 ; @@ -131,13 +145,13 @@ void setup() Serial.println(" - - - T E S T - - - "); -/* test - ac_activate(25, 1); - delay(5000); - ac_activate(27, 2); - delay(5000); + /* test + ac_activate(25, 1); + delay(5000); + ac_activate(27, 2); + delay(5000); -*/ + */ } void loop() @@ -149,11 +163,11 @@ void loop() ac_activate(27, 0); delay(5000); - + if ( r != o_r) { /* - # a : mode or temp b : air_flow, temp, swing, clean + # a : mode or temp b : air_flow, temp, swing, clean, cooling/heating # 18 ~ 30 : temp 0 ~ 2 : flow // on # 0 : off 0 # 1 : on 0 diff --git a/examples/LGACSendDemo/LGACSendDemo.md b/examples/LGACSendDemo/LGACSendDemo.md index 1bff51f..62c7073 100644 --- a/examples/LGACSendDemo/LGACSendDemo.md +++ b/examples/LGACSendDemo/LGACSendDemo.md @@ -1,35 +1,93 @@ -1) Sample raw code : https://gist.github.com/chaeplin/ab2a7ad1533c41260f0d -2) send raw code : https://gist.github.com/chaeplin/7c800d3166463bb51be4 +=== decoding for LG A/C ==== +- 1) remote of LG AC has two type of HDR mark/space, 8000/4000 and 3100/10000 +- 2) HDR 8000/4000 is decoded using decodeLG(IRrecvDumpV2) without problem +- 3) for HDR 3100/10000, use AnalysIR's code : http://www.analysir.com/blog/2014/03/19/air-conditioners-problems-recording-long-infrared-remote-control-signals-arduino/ +- 4) for bin output based on AnalysIR's code : https://gist.github.com/chaeplin/a3a4b4b6b887c663bfe8 +- 5) remove first two byte(11) +- 6) sample rawcode with bin output : https://gist.github.com/chaeplin/134d232e0b8cfb898860 === *** === +- 1) Sample raw code : https://gist.github.com/chaeplin/ab2a7ad1533c41260f0d +- 2) send raw code : https://gist.github.com/chaeplin/7c800d3166463bb51be4 + + +=== *** === +- (0) : Cooling or Heating - (1) : fixed - (2) : fixed - (3) : special(power, swing, air clean) -- (4) : change air flow, temperature +- (4) : change air flow, temperature, cooling(0)/heating(4) - (5) : temperature ( 15 + (5) = ) - (6) : air flow - (7) : crc ( 3 + 4 + 5 + 6 ) & B00001111 -=== *** === -| status | (1)| (2)| (3)| (4)| (5)| (6)| (7) -|----------------|----|----|----|----|----|----|---- -| on / 25 / mid |1000|1000|0000|0000|1010|0010|1100 -| on / 26 / mid |1000|1000|0000|0000|1011|0010|1101 -| on / 27 / mid |1000|1000|0000|0000|1100|0010|1110 -| on / 28 / mid |1000|1000|0000|0000|1101|0010|1111 -| on / 25 / high |1000|1000|0000|0000|1010|0100|1110 -| on / 26 / high |1000|1000|0000|0000|1011|0100|1111 -| on / 27 / high |1000|1000|0000|0000|1100|0100|0000 -| on / 28 / high |1000|1000|0000|0000|1101|0100|0001 -| 1 up |1000|1000|0000|1000|1101|0100|1001 -| Cool power |1000|1000|0001|0000|0000|1100|1101 -| energy saving |1000|1000|0001|0000|0000|0100|0101 -| power |1000|1000|0001|0000|0000|1000|1001 -| flow/up/down |1000|1000|0001|0011|0001|0100|1001 -| up/down off |1000|1000|0001|0011|0001|0101|1010 -| flow/left/right|1000|1000|0001|0011|0001|0110|1011 -| left/right off |1000|1000|0001|0011|0001|0111|1100 -| Air clean |1000|1000|1100|0000|0000|0000|1100 -| off |1000|1000|1100|0000|0000|0101|0001 \ No newline at end of file +°F = °C × 1.8 + 32 +°C = (°F − 32) / 1.8 + + +=== *** === +* remote / Korea / without heating + +| status |(0)| (1)| (2)| (3)| (4)| (5)| (6)| (7) +|----------------|---|----|----|----|----|----|----|---- +| on / 25 / mid | C |1000|1000|0000|0000|1010|0010|1100 +| on / 26 / mid | C |1000|1000|0000|0000|1011|0010|1101 +| on / 27 / mid | C |1000|1000|0000|0000|1100|0010|1110 +| on / 28 / mid | C |1000|1000|0000|0000|1101|0010|1111 +| on / 25 / high | C |1000|1000|0000|0000|1010|0100|1110 +| on / 26 / high | C |1000|1000|0000|0000|1011|0100|1111 +| on / 27 / high | C |1000|1000|0000|0000|1100|0100|0000 +| on / 28 / high | C |1000|1000|0000|0000|1101|0100|0001 +|----------------|---|----|----|----|----|----|----|---- +| 1 up | C |1000|1000|0000|1000|1101|0100|1001 +|----------------|---|----|----|----|----|----|----|---- +| Cool power | C |1000|1000|0001|0000|0000|1100|1101 +| energy saving | C |1000|1000|0001|0000|0000|0100|0101 +| power | C |1000|1000|0001|0000|0000|1000|1001 +| flow/up/down | C |1000|1000|0001|0011|0001|0100|1001 +| up/down off | C |1000|1000|0001|0011|0001|0101|1010 +| flow/left/right| C |1000|1000|0001|0011|0001|0110|1011 +| left/right off | C |1000|1000|0001|0011|0001|0111|1100 +|----------------|---|----|----|----|----|----|----|---- +| Air clean | C |1000|1000|1100|0000|0000|0000|1100 +|----------------|---|----|----|----|----|----|----|---- +| off | C |1000|1000|1100|0000|0000|0101|0001 + + + +* remote / with heating +* converted using raw code at https://github.com/chaeplin/RaspAC/blob/master/lircd.conf + +| status |(0)| (1)| (2)| (3)| (4)| (5)| (6)| (7) +|----------------|---|----|----|----|----|----|----|---- +| on | C |1000|1000|0000|0000|1011|0010|1101 +|----------------|---|----|----|----|----|----|----|---- +| off | C |1000|1000|1100|0000|0000|0101|0001 +|----------------|---|----|----|----|----|----|----|---- +| 64 / 18 | C |1000|1000|0000|0000|0011|0100|0111 +| 66 / 19 | C |1000|1000|0000|0000|0100|0100|1000 +| 68 / 20 | C |1000|1000|0000|0000|0101|0100|1001 +| 70 / 21 | C |1000|1000|0000|0000|0110|0100|1010 +| 72 / 22 | C |1000|1000|0000|0000|0111|0100|1011 +| 74 / 23 | C |1000|1000|0000|0000|1000|0100|1100 +| 76 / 25 | C |1000|1000|0000|0000|1010|0100|1110 +| 78 / 26 | C |1000|1000|0000|0000|1011|0100|1111 +| 80 / 27 | C |1000|1000|0000|0000|1100|0100|0000 +| 82 / 28 | C |1000|1000|0000|0000|1101|0100|0001 +| 84 / 29 | C |1000|1000|0000|0000|1110|0100|0010 +| 86 / 30 | C |1000|1000|0000|0000|1111|0100|0011 +|----------------|---|----|----|----|----|----|----|---- +| heat64 | H |1000|1000|0000|0100|0011|0100|1011 +| heat66 | H |1000|1000|0000|0100|0100|0100|1100 +| heat68 | H |1000|1000|0000|0100|0101|0100|1101 +| heat70 | H |1000|1000|0000|0100|0110|0100|1110 +| heat72 | H |1000|1000|0000|0100|0111|0100|1111 +| heat74 | H |1000|1000|0000|0100|1000|0100|0000 +| heat76 | H |1000|1000|0000|0100|1001|0100|0001 +| heat78 | H |1000|1000|0000|0100|1011|0100|0011 +| heat80 | H |1000|1000|0000|0100|1100|0100|0100 +| heat82 | H |1000|1000|0000|0100|1101|0100|0101 +| heat84 | H |1000|1000|0000|0100|1110|0100|0110 +| heat86 | H |1000|1000|0000|0100|1111|0100|0111