that_one_nigga_you_k

example 1

Nov 7th, 2018
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.49 KB | None | 0 0
  1. /*
  2.  * IRremote: IRsendRawDemo - demonstrates sending IR codes with sendRaw
  3.  * An IR LED must be connected to Arduino PWM pin 3.
  4.  * Version 0.1 July, 2009
  5.  * Copyright 2009 Ken Shirriff
  6.  * http://arcfn.com
  7.  *
  8.  * IRsendRawDemo - added by AnalysIR (via www.AnalysIR.com), 24 August 2015
  9.  *
  10.  * This example shows how to send a RAW signal using the IRremote library.
  11.  * The example signal is actually a 32 bit NEC signal.
  12.  * Remote Control button: LGTV Power On/Off.
  13.  * Hex Value: 0x20DF10EF, 32 bits
  14.  *
  15.  * It is more efficient to use the sendNEC function to send NEC signals.
  16.  * Use of sendRaw here, serves only as an example of using the function.
  17.  *
  18.  */
  19.  
  20.  
  21. #include <IRremote.h>
  22.  
  23. IRsend irsend;
  24.  
  25. void setup()
  26. {
  27.  
  28. }
  29.  
  30. void loop() {
  31.   int khz = 38; // 38kHz carrier frequency for the NEC protocol
  32.   unsigned int irSignal[] = {9000, 4500, 560, 560, 560, 560, 560, 1690, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 1690, 560, 1690, 560, 560, 560, 1690, 560, 1690, 560, 1690, 560, 1690, 560, 1690, 560, 560, 560, 560, 560, 560, 560, 1690, 560, 560, 560, 560, 560, 560, 560, 560, 560, 1690, 560, 1690, 560, 1690, 560, 560, 560, 1690, 560, 1690, 560, 1690, 560, 1690, 560, 39416, 9000, 2210, 560}; //AnalysIR Batch Export (IRremote) - RAW
  33.  
  34.   irsend.sendRaw(irSignal, sizeof(irSignal) / sizeof(irSignal[0]), khz); //Note the approach used to automatically calculate the size of the array.
  35.  
  36.   delay(5000); //In this example, the signal will be repeated every 5 seconds, approximately.
  37. }
Add Comment
Please, Sign In to add comment