You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
929B

  1. /*
  2. * IRremote: IRsendDemo - demonstrates sending IR codes with IRsend
  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. * JVC and Panasonic protocol added by Kristian Lauszus (Thanks to zenwheel and other people at the original blog post)
  8. */
  9. #include <IRremote.h>
  10. #define PanasonicAddress 0x4004 // Panasonic address (Pre data)
  11. #define PanasonicPower 0x100BCBD // Panasonic Power button
  12. #define JVCPower 0xC5E8
  13. IRsend irsend;
  14. void setup()
  15. {
  16. }
  17. void loop() {
  18. irsend.sendPanasonic(PanasonicAddress,PanasonicPower); // This should turn your TV on and off
  19. irsend.sendJVC(JVCPower, 16,0); // hex value, 16 bits, no repeat
  20. delayMicroseconds(50); // see http://www.sbprojects.com/knowledge/ir/jvc.php for information
  21. irsend.sendJVC(JVCPower, 16,1); // hex value, 16 bits, repeat
  22. delayMicroseconds(50);
  23. }