Skip to content

Commit 625a50b

Browse files
authored
Add an example of sendRaw() to IRsendDemo.ino (#270)
People seem to ask how to do this fairly regularly (#269). Adding an example of it.
1 parent 312d39e commit 625a50b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

examples/IRsendDemo/IRsendDemo.ino

+12
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,15 @@
3535

3636
IRsend irsend(4); // An IR LED is controlled by GPIO pin 4 (D2)
3737

38+
// Example of data captured by IRrecvDumpV2.ino
39+
uint16_t rawData[67] = {9000, 4500, 650, 550, 650, 1650, 600, 550, 650, 550,
40+
600, 1650, 650, 550, 600, 1650, 650, 1650, 650, 1650,
41+
600, 550, 650, 1650, 650, 1650, 650, 550, 600, 1650,
42+
650, 1650, 650, 550, 650, 550, 650, 1650, 650, 550,
43+
650, 550, 650, 550, 600, 550, 650, 550, 650, 550,
44+
650, 1650, 600, 550, 650, 1650, 650, 1650, 650, 1650,
45+
650, 1650, 650, 1650, 650, 1650, 600};
46+
3847
void setup() {
3948
irsend.begin();
4049
Serial.begin(115200, SERIAL_8N1, SERIAL_TX_ONLY);
@@ -47,4 +56,7 @@ void loop() {
4756
Serial.println("Sony");
4857
irsend.sendSony(0xa90, 12, 2);
4958
delay(2000);
59+
Serial.println("a rawData capture from IRrecvDumpV2");
60+
irsend.sendRaw(rawData, 67, 38); // Send a raw data capture at 38kHz.
61+
delay(2000);
5062
}

0 commit comments

Comments
 (0)