Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* rawSend.ino Example sketch for IRLib2
- * Illustrates how to send a code Using raw timings which were captured
- * from the "rawRecv.ino" sample sketch. Load that sketch and
- * capture the values. They will print in the serial monitor. Then you
- * cut and paste that output into the appropriate section below.
- */
- #include <IRLibSendBase.h> //We need the base code
- #include <IRLib_HashRaw.h> //Only use raw sender
- IRsendRaw mySender;
- void setup() {
- Serial.begin(9600);
- delay(2000); while (!Serial); //delay for Leonardo
- Serial.println(F("Every time you press a key is a serial monitor we will send."));
- }
- /* Cut and paste the output from "rawRecv.ino" below here. It will
- * consist of a #define RAW_DATA_LEN statement and an array definition
- * beginning with "uint16_t rawData[RAW_DATA_LEN]= {…" and concludes
- * with "…,1000};"
- */
- #define RAW_DATA_LEN 68
- uint16_t rawDataOff[RAW_DATA_LEN]={
- 8882, 4538, 498, 630, 498, 606, 518, 606,
- 498, 630, 498, 606, 518, 606, 498, 630,
- 498, 606, 518, 1734, 498, 1730, 498, 1734,
- 522, 1730, 498, 606, 522, 1734, 498, 1730,
- 498, 1734, 522, 602, 498, 1734, 522, 606,
- 494, 634, 494, 606, 522, 606, 494, 634,
- 494, 606, 522, 1730, 498, 606, 522, 1734,
- 494, 1734, 494, 1734, 522, 1734, 498, 1730,
- 498, 1734, 522, 1000};
- uint16_t rawDataOn[RAW_DATA_LEN]={
- 8910, 4506, 522, 606, 498, 602, 526, 602,
- 522, 606, 498, 602, 526, 602, 522, 602,
- 498, 606, 526, 1726, 502, 1730, 522, 1706,
- 526, 1730, 498, 606, 522, 1730, 498, 1730,
- 526, 1706, 526, 1730, 498, 1730, 526, 602,
- 498, 606, 522, 602, 526, 602, 498, 602,
- 526, 602, 522, 606, 498, 602, 526, 1730,
- 498, 1730, 526, 1706, 526, 1726, 502, 1730,
- 522, 1706, 526, 1000};
- /*
- * Cut-and-paste into the area above.
- */
- void loop() {
- mySender.send(rawDataOff,RAW_DATA_LEN,36);
- delay(30);
- mySender.send(rawDataOn,RAW_DATA_LEN,36);
- delay(30);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement