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."));
- }
- #define RAW_DATA_LEN 584
- uint16_t rawData[RAW_DATA_LEN]={
- 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};
- void loop() {
- if (Serial.read() != -1) {
- //send a code every time a character is received from the
- // serial port. You could modify this sketch to send when you
- // push a button connected to an digital input pin.
- mySender.send(rawData,RAW_DATA_LEN,36);//Pass the buffer,length, optionally frequency
- Serial.println(F("Sent signal."));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement