Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * IRremote: IRsendRawDemo - demonstrates sending IR codes with sendRaw
- * An IR LED must be connected to Arduino PWM pin 3.
- * Version 0.1 July, 2009
- * Copyright 2009 Ken Shirriff
- * http://arcfn.com
- *
- * IRsendRawDemo - added by AnalysIR (via www.AnalysIR.com), 24 August 2015
- *
- * This example shows how to send a RAW signal using the IRremote library.
- * The example signal is actually a 32 bit NEC signal.
- * Remote Control button: LGTV Power On/Off.
- * Hex Value: 0x20DF10EF, 32 bits
- *
- * It is more efficient to use the sendNEC function to send NEC signals.
- * Use of sendRaw here, serves only as an example of using the function.
- *
- */
- #include <IRremote.h>
- IRsend irsend;
- void setup()
- {
- }
- void loop() {
- int khz = 38; // 38kHz carrier frequency for the NEC protocol
- unsigned int irSignal[] = {3400, -1728, 416, -1296, 432, -1280, 428, -432, 432, -428, 420, -448, 428, -1280, 432, -432, 344, -516, 428, -1280, 432, -1276, 348, -516, 420, -1296, 344, -516, 348, -516, 428, -1280, 344, -1372, 344, -516, 428, -1284, 432, -1276, 420, -448, 428, -432, 412, -1300, 428, -428, 432, -432, 464, -1260, 344, -520, 344, -520, 344, -516, 432, -428, 344, -516, 416, -448, 404, -460, 344, -520, 344, -520, 400, -460, 428, -432, 428, -432, 432, -428, 404, -456, 416, -448, 432, -424, 348, -520, 432, -428, 496, -372, 344, -516, 348, -1364, 432, -428, 432, -432, 456, -404, 412, -448, 420, -444, 404, -1308, 348, -1364, 348, -516, 428, -432, 428, -432, 432, -428, 432, -428, 432, -1280, 344, -1372, 428, -432, 344, -520, 428, -432, 384, -480, 344, -516, 344, -1372, 428, -1284, 428, -428, 436, -1276, 416, -1304, 348, -516, 416, -448, 428, -432, 432, -428, 428, -428, 432, -428, 432, -428, 348, -516, 428, -1280, 348, -516, 344, -520, 416, -444, 348, -516, 416, -1296, 348, -1368, 344, -1368, 432, -1280, 348, -516, 428, -432, 428, -428, 432, -428, 344, -516, 428, -432, 400, -460, 416, -448, 348, -520, 396, -464, 344, -520, 400, -460, 432, -428, 432, -428, 432, -428, 344, -516, 416, -448, 432, -432, 344, -516, 432, -432, 416, -448, 344, -516, 344, -516, 344, -516, 432, -428, 344, -516, 344, -520, 432, -432, 344, -520, 400, -460, 480, -1244, 432, -428, 432, -432, 428, -432, 432, -428, 428, -428, 432, -428, 348, -516, 344, -516, 348, -512, 344, -520, 432, -428, 428, -428, 432, -432, 344, -516, 348, -516, 432, -432, 432, -424, 432, -428, 404, -1312, 344, -1372, 416, -1296, 344, -516, 344, -520, 344, -1368, 344, -1368, 416, -448, 432, -16928, 3536, -1724, 432, -1280, 432, -1276, 348, -516, 420, -444, 416, -448, 344, -1368, 452, -416, 344, -520, 344, -1364, 348, -1368, 452, -416, 344, -1380, 432, -428, 344, -516, 416, -1304, 344, -1368, 432, -428, 432, -1280, 344, -1368, 432, -432, 428, -432, 344, -1368, 432, -428, 432, -428, 432, -1280, 344, -520, 428, -432, 344, -520, 428, -428, 344, -516, 416, -452, 344, -520, 344, -516, 348, -516, 344, -520, 428, -428, 432, -428, 432, -432, 344, -516, 364, -500, 428, -428, 344, -520, 432, -428, 496, -376, 344, -516, 344, -1368, 432, -428, 428, -432, 432, -432, 344, -516, 416, -448, 344, -1368, 344, -1368, 344, -516, 432, -432, 428, -432, 432, -428, 428, -432, 428, -1284, 400, -1312, 432, -428, 348, -516, 432, -432, 344, -516, 348, -512, 344, -1372, 432, -1280, 428, -432, 432, -1280, 364, -1348, 432, -432, 428, -432, 428, -432, 432, -428, 432, -424, 432, -428, 348, -516, 400, -464, 344, -1368, 428, -436, 424, -432, 452, -416, 452, -412, 400, -1316, 428, -1280, 432, -1280, 428, -1284, 344, -520, 344, -516, 344, -516, 428, -432, 348, -516, 428, -428, 400, -464, 364, -500, 344, -520, 344, -516, 348, -516, 400, -464, 428, -432, 424, -432, 432, -432, 400, -460, 364, -500, 428, -428, 344, -520, 432, -432, 468, -400, 344, -516, 344, -516, 428, -432, 432, -432, 428, -436, 344, -516, 428, -432, 428, -428, 416, -448, 428, -1284, 428, -432, 416, -448, 432, -432, 364, -496, 400, -464, 420, -448, 428, -432, 428, -432, 428, -432, 428, -428, 344, -520, 428, -428, 428, -432, 364, -500, 344, -516, 428, -432, 344, -520, 344, -524, 424, -1284, 428, -1280, 432, -1280, 396, -468, 344, -516, 472, -1260, 344, -1368, 416, -444, 368}; //AnalysIR Batch Export (IRremote) - RAW
- irsend.sendRaw(irSignal, sizeof(irSignal) / sizeof(irSignal[0]), khz); //Note the approach used to automatically calculate the size of the array.
- delay(5000); //In this example, the signal will be repeated every 5 seconds, approximately.
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement