Advertisement
Guest User

IRrawSend.ino

a guest
Jul 18th, 2014
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.93 KB | None | 0 0
  1. #include <IRLib.h>
  2.  
  3. IRsend My_Sender;
  4.  
  5. int khz=38; //NB Change this default value as neccessary to the correct modulation frequency
  6. int buttonPin = 4;
  7. int buttonState = 0;
  8. unsigned int Signal_0_0[] = {350, 350, 100, 350, 100, 650, 100, 300, 150, 300, 150, 800, 100, 350, 100, 300, 150, 300, 100, 350, 100, 650, 100, 500, 100, 650, 150, 450, 150, 450, 150, 800, 100, 350, 100, 23264, 350, 350, 100, 300, 150, 650, 100, 300, 150, 350, 50, 850, 100, 300, 150, 300, 100, 350, 100, 350, 100, 650, 100, 500, 100, 650, 100, 500, 150, 450, 150, 800, 100, 350, 100};
  9.  
  10. void setup()
  11. {
  12.   Serial.begin(115200);
  13.   pinMode(buttonPin, INPUT);
  14. }
  15.  
  16. //send a code every time a character is received from the serial port
  17. void loop() {
  18.   buttonState = digitalRead(buttonPin);
  19.   if (buttonState == HIGH) {
  20.     Serial.println("Sending RAW code");
  21.     My_Sender.IRsendRaw::send(Signal_0_0, sizeof(Signal_0_0)/sizeof(int), khz);
  22.     delay(3000);
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement