Advertisement
Guest User

Untitled

a guest
Jun 28th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.87 KB | None | 0 0
  1. /* rawSend.ino Example sketch for IRLib2
  2. * Illustrates how to send a code Using raw timings which were captured
  3. * from the "rawRecv.ino" sample sketch. Load that sketch and
  4. * capture the values. They will print in the serial monitor. Then you
  5. * cut and paste that output into the appropriate section below.
  6. */
  7. #include <IRLibSendBase.h> //We need the base code
  8. #include <IRLib_HashRaw.h> //Only use raw sender
  9.  
  10. IRsendRaw mySender;
  11.  
  12. void setup() {
  13. Serial.begin(9600);
  14. delay(2000); while (!Serial); //delay for Leonardo
  15. Serial.println(F("Every time you press a key is a serial monitor we will send."));
  16. }
  17. /* Cut and paste the output from "rawRecv.ino" below here. It will
  18. * consist of a #define RAW_DATA_LEN statement and an array definition
  19. * beginning with "uint16_t rawData[RAW_DATA_LEN]= {…" and concludes
  20. * with "…,1000};"
  21. */
  22.  
  23.  
  24. #define RAW_DATA_LEN 68
  25. uint16_t rawDataOff[RAW_DATA_LEN]={
  26. 8882, 4538, 498, 630, 498, 606, 518, 606,
  27. 498, 630, 498, 606, 518, 606, 498, 630,
  28. 498, 606, 518, 1734, 498, 1730, 498, 1734,
  29. 522, 1730, 498, 606, 522, 1734, 498, 1730,
  30. 498, 1734, 522, 602, 498, 1734, 522, 606,
  31. 494, 634, 494, 606, 522, 606, 494, 634,
  32. 494, 606, 522, 1730, 498, 606, 522, 1734,
  33. 494, 1734, 494, 1734, 522, 1734, 498, 1730,
  34. 498, 1734, 522, 1000};
  35.  
  36. uint16_t rawDataOn[RAW_DATA_LEN]={
  37. 8910, 4506, 522, 606, 498, 602, 526, 602,
  38. 522, 606, 498, 602, 526, 602, 522, 602,
  39. 498, 606, 526, 1726, 502, 1730, 522, 1706,
  40. 526, 1730, 498, 606, 522, 1730, 498, 1730,
  41. 526, 1706, 526, 1730, 498, 1730, 526, 602,
  42. 498, 606, 522, 602, 526, 602, 498, 602,
  43. 526, 602, 522, 606, 498, 602, 526, 1730,
  44. 498, 1730, 526, 1706, 526, 1726, 502, 1730,
  45. 522, 1706, 526, 1000};
  46.  
  47.  
  48.  
  49. /*
  50. * Cut-and-paste into the area above.
  51. */
  52.  
  53. void loop() {
  54. mySender.send(rawDataOff,RAW_DATA_LEN,36);
  55. delay(30);
  56. mySender.send(rawDataOn,RAW_DATA_LEN,36);
  57. delay(30);
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement