Advertisement
Guest User

Untitled

a guest
Nov 7th, 2018
276
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.98 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.  
  18. #define RAW_DATA_LEN 584
  19. uint16_t rawData[RAW_DATA_LEN]={
  20. 3400, 1700, 433, 1299, 433, 1299, 433, 433, 433, 433, 433, 433, 433, 1299, 433, 433, 433, 433, 433, 1299, 433, 1299, 433, 433, 433, 1299, 433, 433, 433, 433, 433, 1299, 433, 1299, 433, 433, 433, 1299, 433, 1299, 433, 433, 433, 433, 433, 1299, 433, 433, 433, 433, 433, 1299, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 1299, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 1299, 433, 1299, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 1299, 433, 1299, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 1299, 433, 1299, 433, 433, 433, 1299, 433, 1299, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 1299, 433, 433, 433, 433, 433, 433, 433, 433, 433, 1299, 433, 1299, 433, 1299, 433, 1299, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 1299, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 1299, 433, 1299, 433, 1299, 433, 433, 433, 433, 433, 1299, 433, 1299, 433, 433, 433, 16928, 3400, 1700, 433, 1299, 433, 1299, 433, 433, 433, 433, 433, 433, 433, 1299, 433, 433, 433, 433, 433, 1299, 433, 1299, 433, 433, 433, 1299, 433, 433, 433, 433, 433, 1299, 433, 1299, 433, 433, 433, 1299, 433, 1299, 433, 433, 433, 433, 433, 1299, 433, 433, 433, 433, 433, 1299, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 1299, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 1299, 433, 1299, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 1299, 433, 1299, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 1299, 433, 1299, 433, 433, 433, 1299, 433, 1299, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 1299, 433, 433, 433, 433, 433, 433, 433, 433, 433, 1288, 433, 1299, 433, 1299, 433, 1299, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 1299, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 1299, 433, 1299, 433, 1299, 433, 433, 433, 433, 433, 1299, 433, 1299, 433, 433, 433, 1000};
  21.  
  22. void loop() {
  23. if (Serial.read() != -1) {
  24. //send a code every time a character is received from the
  25. // serial port. You could modify this sketch to send when you
  26. // push a button connected to an digital input pin.
  27. mySender.send(rawData,RAW_DATA_LEN,36);//Pass the buffer,length, optionally frequency
  28. Serial.println(F("Sent signal."));
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement