Skip to content

Commit cdd783c

Browse files
committed
Merge pull request Arduino-IRremote#212 from chaeplin/master
LG_AC : heating option
2 parents bce86bf + a237a0e commit cdd783c

File tree

2 files changed

+104
-32
lines changed

2 files changed

+104
-32
lines changed

examples/LGACSendDemo/LGACSendDemo.ino

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ IRrecv irrecv (RECV_PIN);
1010
const int AC_TYPE = 0;
1111
// 0 : TOWER
1212
// 1 : WALL
13+
//
14+
15+
int AC_HEAT = 0;
16+
// 0 : cooling
17+
// 1 : heating
1318

1419
int AC_POWER_ON = 0;
1520
// 0 : off
@@ -27,6 +32,8 @@ int AC_FLOW = 1;
2732
// 1 : mid
2833
// 2 : high
2934
// if AC_TYPE =1, 3 : change
35+
//
36+
3037

3138
const int AC_FLOW_TOWER[3] = {0, 4, 6};
3239
const int AC_FLOW_WALL[4] = {0, 2, 4, 5};
@@ -54,7 +61,14 @@ void ac_activate(int temperature, int air_flow)
5461
int AC_MSBITS1 = 8;
5562
int AC_MSBITS2 = 8;
5663
int AC_MSBITS3 = 0;
57-
int AC_MSBITS4 = 0;
64+
int AC_MSBITS4 ;
65+
if ( AC_HEAT == 1 ) {
66+
// heating
67+
AC_MSBITS4 = 4;
68+
} else {
69+
// cooling
70+
AC_MSBITS4 = 0;
71+
}
5872
int AC_MSBITS5 = temperature - 15;
5973
int AC_MSBITS6 ;
6074

@@ -131,13 +145,13 @@ void setup()
131145

132146
Serial.println(" - - - T E S T - - - ");
133147

134-
/* test
135-
ac_activate(25, 1);
136-
delay(5000);
137-
ac_activate(27, 2);
138-
delay(5000);
148+
/* test
149+
ac_activate(25, 1);
150+
delay(5000);
151+
ac_activate(27, 2);
152+
delay(5000);
139153
140-
*/
154+
*/
141155
}
142156

143157
void loop()
@@ -149,11 +163,11 @@ void loop()
149163
ac_activate(27, 0);
150164
delay(5000);
151165

152-
166+
153167
if ( r != o_r) {
154168

155169
/*
156-
# a : mode or temp b : air_flow, temp, swing, clean
170+
# a : mode or temp b : air_flow, temp, swing, clean, cooling/heating
157171
# 18 ~ 30 : temp 0 ~ 2 : flow // on
158172
# 0 : off 0
159173
# 1 : on 0
Lines changed: 81 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,93 @@
1-
1) Sample raw code : https://gist.github.com/chaeplin/ab2a7ad1533c41260f0d
2-
2) send raw code : https://gist.github.com/chaeplin/7c800d3166463bb51be4
1+
=== decoding for LG A/C ====
2+
- 1) remote of LG AC has two type of HDR mark/space, 8000/4000 and 3100/10000
3+
- 2) HDR 8000/4000 is decoded using decodeLG(IRrecvDumpV2) without problem
4+
- 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/
5+
- 4) for bin output based on AnalysIR's code : https://gist.github.com/chaeplin/a3a4b4b6b887c663bfe8
6+
- 5) remove first two byte(11)
7+
- 6) sample rawcode with bin output : https://gist.github.com/chaeplin/134d232e0b8cfb898860
38

49

510
=== *** ===
11+
- 1) Sample raw code : https://gist.github.com/chaeplin/ab2a7ad1533c41260f0d
12+
- 2) send raw code : https://gist.github.com/chaeplin/7c800d3166463bb51be4
13+
14+
15+
=== *** ===
16+
- (0) : Cooling or Heating
617
- (1) : fixed
718
- (2) : fixed
819
- (3) : special(power, swing, air clean)
9-
- (4) : change air flow, temperature
20+
- (4) : change air flow, temperature, cooling(0)/heating(4)
1021
- (5) : temperature ( 15 + (5) = )
1122
- (6) : air flow
1223
- (7) : crc ( 3 + 4 + 5 + 6 ) & B00001111
1324

25+
26+
°F = °C × 1.8 + 32
27+
°C = (°F − 32) / 1.8
28+
29+
1430
=== *** ===
31+
* remote / Korea / without heating
32+
33+
| status |(0)| (1)| (2)| (3)| (4)| (5)| (6)| (7)
34+
|----------------|---|----|----|----|----|----|----|----
35+
| on / 25 / mid | C |1000|1000|0000|0000|1010|0010|1100
36+
| on / 26 / mid | C |1000|1000|0000|0000|1011|0010|1101
37+
| on / 27 / mid | C |1000|1000|0000|0000|1100|0010|1110
38+
| on / 28 / mid | C |1000|1000|0000|0000|1101|0010|1111
39+
| on / 25 / high | C |1000|1000|0000|0000|1010|0100|1110
40+
| on / 26 / high | C |1000|1000|0000|0000|1011|0100|1111
41+
| on / 27 / high | C |1000|1000|0000|0000|1100|0100|0000
42+
| on / 28 / high | C |1000|1000|0000|0000|1101|0100|0001
43+
|----------------|---|----|----|----|----|----|----|----
44+
| 1 up | C |1000|1000|0000|1000|1101|0100|1001
45+
|----------------|---|----|----|----|----|----|----|----
46+
| Cool power | C |1000|1000|0001|0000|0000|1100|1101
47+
| energy saving | C |1000|1000|0001|0000|0000|0100|0101
48+
| power | C |1000|1000|0001|0000|0000|1000|1001
49+
| flow/up/down | C |1000|1000|0001|0011|0001|0100|1001
50+
| up/down off | C |1000|1000|0001|0011|0001|0101|1010
51+
| flow/left/right| C |1000|1000|0001|0011|0001|0110|1011
52+
| left/right off | C |1000|1000|0001|0011|0001|0111|1100
53+
|----------------|---|----|----|----|----|----|----|----
54+
| Air clean | C |1000|1000|1100|0000|0000|0000|1100
55+
|----------------|---|----|----|----|----|----|----|----
56+
| off | C |1000|1000|1100|0000|0000|0101|0001
57+
58+
59+
60+
* remote / with heating
61+
* converted using raw code at https://github.com/chaeplin/RaspAC/blob/master/lircd.conf
1562

16-
| status | (1)| (2)| (3)| (4)| (5)| (6)| (7)
17-
|----------------|----|----|----|----|----|----|----
18-
| on / 25 / mid |1000|1000|0000|0000|1010|0010|1100
19-
| on / 26 / mid |1000|1000|0000|0000|1011|0010|1101
20-
| on / 27 / mid |1000|1000|0000|0000|1100|0010|1110
21-
| on / 28 / mid |1000|1000|0000|0000|1101|0010|1111
22-
| on / 25 / high |1000|1000|0000|0000|1010|0100|1110
23-
| on / 26 / high |1000|1000|0000|0000|1011|0100|1111
24-
| on / 27 / high |1000|1000|0000|0000|1100|0100|0000
25-
| on / 28 / high |1000|1000|0000|0000|1101|0100|0001
26-
| 1 up |1000|1000|0000|1000|1101|0100|1001
27-
| Cool power |1000|1000|0001|0000|0000|1100|1101
28-
| energy saving |1000|1000|0001|0000|0000|0100|0101
29-
| power |1000|1000|0001|0000|0000|1000|1001
30-
| flow/up/down |1000|1000|0001|0011|0001|0100|1001
31-
| up/down off |1000|1000|0001|0011|0001|0101|1010
32-
| flow/left/right|1000|1000|0001|0011|0001|0110|1011
33-
| left/right off |1000|1000|0001|0011|0001|0111|1100
34-
| Air clean |1000|1000|1100|0000|0000|0000|1100
35-
| off |1000|1000|1100|0000|0000|0101|0001
63+
| status |(0)| (1)| (2)| (3)| (4)| (5)| (6)| (7)
64+
|----------------|---|----|----|----|----|----|----|----
65+
| on | C |1000|1000|0000|0000|1011|0010|1101
66+
|----------------|---|----|----|----|----|----|----|----
67+
| off | C |1000|1000|1100|0000|0000|0101|0001
68+
|----------------|---|----|----|----|----|----|----|----
69+
| 64 / 18 | C |1000|1000|0000|0000|0011|0100|0111
70+
| 66 / 19 | C |1000|1000|0000|0000|0100|0100|1000
71+
| 68 / 20 | C |1000|1000|0000|0000|0101|0100|1001
72+
| 70 / 21 | C |1000|1000|0000|0000|0110|0100|1010
73+
| 72 / 22 | C |1000|1000|0000|0000|0111|0100|1011
74+
| 74 / 23 | C |1000|1000|0000|0000|1000|0100|1100
75+
| 76 / 25 | C |1000|1000|0000|0000|1010|0100|1110
76+
| 78 / 26 | C |1000|1000|0000|0000|1011|0100|1111
77+
| 80 / 27 | C |1000|1000|0000|0000|1100|0100|0000
78+
| 82 / 28 | C |1000|1000|0000|0000|1101|0100|0001
79+
| 84 / 29 | C |1000|1000|0000|0000|1110|0100|0010
80+
| 86 / 30 | C |1000|1000|0000|0000|1111|0100|0011
81+
|----------------|---|----|----|----|----|----|----|----
82+
| heat64 | H |1000|1000|0000|0100|0011|0100|1011
83+
| heat66 | H |1000|1000|0000|0100|0100|0100|1100
84+
| heat68 | H |1000|1000|0000|0100|0101|0100|1101
85+
| heat70 | H |1000|1000|0000|0100|0110|0100|1110
86+
| heat72 | H |1000|1000|0000|0100|0111|0100|1111
87+
| heat74 | H |1000|1000|0000|0100|1000|0100|0000
88+
| heat76 | H |1000|1000|0000|0100|1001|0100|0001
89+
| heat78 | H |1000|1000|0000|0100|1011|0100|0011
90+
| heat80 | H |1000|1000|0000|0100|1100|0100|0100
91+
| heat82 | H |1000|1000|0000|0100|1101|0100|0101
92+
| heat84 | H |1000|1000|0000|0100|1110|0100|0110
93+
| heat86 | H |1000|1000|0000|0100|1111|0100|0111

0 commit comments

Comments
 (0)