Advertisement
patriotaSJ

IR Remote Control with Infrared Reveiver

Apr 17th, 2015
625
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.57 KB | None | 0 0
  1. //Todo el tutorial lo encontras http://cursoarduinomega.blogspot.com.ar/2015/04/ir-remote-control-with-infrared-reveiver.html
  2. #include <IRremote.h>
  3. int RECV_PIN = 11;
  4. int led = 8;
  5. IRrecv irrecv(RECV_PIN);
  6. decode_results results;
  7.  
  8. void setup()
  9. {
  10.   Serial.begin(9600);
  11.   irrecv.enableIRIn(); // Start the receiver
  12.   pinMode(led, OUTPUT);
  13. }
  14.  
  15. void loop()
  16. {
  17.   if (irrecv.decode(&results))
  18.     {
  19.      digitalWrite(led,HIGH);
  20.      delay(500);
  21.      digitalWrite(led,LOW);
  22.      Serial.println(results.value, HEX);
  23.      irrecv.resume(); // Receive the next value
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement