|
1 | 1 | /* IRremoteESP8266: IRsendDemo - demonstrates sending IR codes with IRsend.
|
2 | 2 | *
|
3 |
| - * Version 1.0 April, 2017 |
| 3 | + * Version 1.1 January, 2019 |
4 | 4 | * Based on Ken Shirriff's IrsendDemo Version 0.1 July, 2009,
|
5 | 5 | * Copyright 2009 Ken Shirriff, http://arcfn.com
|
6 | 6 | *
|
@@ -46,26 +46,27 @@ uint16_t rawData[67] = {9000, 4500, 650, 550, 650, 1650, 600, 550, 650, 550,
|
46 | 46 | 650, 550, 650, 550, 600, 550, 650, 550, 650, 550,
|
47 | 47 | 650, 1650, 600, 550, 650, 1650, 650, 1650, 650, 1650,
|
48 | 48 | 650, 1650, 650, 1650, 650, 1650, 600};
|
| 49 | +// Example Samsung A/C state captured from IRrecvDumpV2.ino |
| 50 | +uint8_t samsungState[kSamsungAcStateLength] = { |
| 51 | + 0x02, 0x92, 0x0F, 0x00, 0x00, 0x00, 0xF0, |
| 52 | + 0x01, 0xE2, 0xFE, 0x71, 0x40, 0x11, 0xF0}; |
49 | 53 |
|
50 | 54 | void setup() {
|
51 | 55 | irsend.begin();
|
52 | 56 | Serial.begin(115200, SERIAL_8N1, SERIAL_TX_ONLY);
|
53 | 57 | }
|
54 | 58 |
|
55 | 59 | void loop() {
|
56 |
| -#if SEND_NEC |
57 | 60 | Serial.println("NEC");
|
58 |
| - irsend.sendNEC(0x00FFE01FUL, 32); |
59 |
| -#endif // SEND_NEC |
| 61 | + irsend.sendNEC(0x00FFE01FUL); |
60 | 62 | delay(2000);
|
61 |
| -#if SEND_SONY |
62 | 63 | Serial.println("Sony");
|
63 |
| - irsend.sendSony(0xa90, 12, 2); |
64 |
| -#endif // SEND_SONY |
| 64 | + irsend.sendSony(0xa90, 12, 2); // 12 bits & 2 repeats |
65 | 65 | delay(2000);
|
66 |
| -#if SEND_RAW |
67 | 66 | Serial.println("a rawData capture from IRrecvDumpV2");
|
68 | 67 | irsend.sendRaw(rawData, 67, 38); // Send a raw data capture at 38kHz.
|
69 |
| -#endif // SEND_RAW |
| 68 | + delay(2000); |
| 69 | + Serial.println("a Samsung A/C state from IRrecvDumpV2"); |
| 70 | + irsend.sendSamsungAC(samsungState); |
70 | 71 | delay(2000);
|
71 | 72 | }
|
0 commit comments