Advertisement
Guest User

Untitled

a guest
Jun 27th, 2016
391
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.54 KB | None | 0 0
  1. /*
  2.  * IRremote: IRrecvDemo - demonstrates receiving IR codes with IRrecv
  3.  * An IR detector/demodulator must be connected to the input RECV_PIN.
  4.  * Version 0.1 July, 2009
  5.  * Copyright 2009 Ken Shirriff
  6.  * http://arcfn.com
  7.  */
  8.  
  9. #include <IRremote.h>
  10.  
  11. int RECV_PIN = 11;
  12.  
  13. IRrecv irrecv(RECV_PIN);
  14.  
  15. decode_results results;
  16.  
  17. void setup()
  18. {
  19.   Serial.begin(9600);
  20.   irrecv.enableIRIn(); // Start the receiver
  21. }
  22.  
  23. void loop() {
  24.   if (irrecv.decode(&results)) {
  25.     Serial.println(results.value, HEX);
  26.     irrecv.resume(); // Receive the next value
  27.   }
  28.   delay(100);
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement