Skip to content

Commit

Permalink
Add an example of sendRaw() to IRsendDemo.ino (#270)
Browse files Browse the repository at this point in the history
People seem to ask how to do this fairly regularly (#269).
Adding an example of it.
  • Loading branch information
crankyoldgit authored Jul 10, 2017
1 parent 312d39e commit 625a50b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions examples/IRsendDemo/IRsendDemo.ino
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@

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

// Example of data captured by IRrecvDumpV2.ino
uint16_t rawData[67] = {9000, 4500, 650, 550, 650, 1650, 600, 550, 650, 550,
600, 1650, 650, 550, 600, 1650, 650, 1650, 650, 1650,
600, 550, 650, 1650, 650, 1650, 650, 550, 600, 1650,
650, 1650, 650, 550, 650, 550, 650, 1650, 650, 550,
650, 550, 650, 550, 600, 550, 650, 550, 650, 550,
650, 1650, 600, 550, 650, 1650, 650, 1650, 650, 1650,
650, 1650, 650, 1650, 650, 1650, 600};

void setup() {
irsend.begin();
Serial.begin(115200, SERIAL_8N1, SERIAL_TX_ONLY);
Expand All @@ -47,4 +56,7 @@ void loop() {
Serial.println("Sony");
irsend.sendSony(0xa90, 12, 2);
delay(2000);
Serial.println("a rawData capture from IRrecvDumpV2");
irsend.sendRaw(rawData, 67, 38); // Send a raw data capture at 38kHz.
delay(2000);
}

0 comments on commit 625a50b

Please sign in to comment.