Advertisement
cymplecy

irsend

Dec 20th, 2015
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.59 KB | None | 0 0
  1. /*
  2.  * IRremoteESP8266: IRsendDemo - demonstrates sending IR codes with IRsend
  3.  * An IR LED must be connected to ESP8266 pin 0.
  4.  * Version 0.1 June, 2015
  5.  * Based on Ken Shirriff's IrsendDemo Version 0.1 July, 2009, Copyright 2009 Ken Shirriff, http://arcfn.com
  6.  */
  7.  
  8. #include <IRremoteESP8266.h>
  9.  
  10. IRsend irsend(0); //an IR led is connected to GPIO pin 0
  11.  
  12. void setup()
  13. {
  14.   irsend.begin();
  15.   Serial.begin(9600);
  16. }
  17.  
  18. void loop() {
  19.   Serial.println("On");
  20.   irsend.sendNEC(0x00FFE01F, 36);
  21.   delay(2000);
  22.   Serial.println("Off");
  23.   irsend.sendNEC(0x00FF609F, 36);
  24.   delay(2000);
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement