Advertisement
AymenSekhri

Mouse Controller by IR (Arduino part)

Sep 7th, 2016
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.34 KB | None | 0 0
  1. #include <IRremote.h>
  2. int RECV_PIN = 2; // out of IR reciever
  3. IRrecv irrecv(RECV_PIN);
  4. decode_results results;
  5. void setup()
  6. {
  7.   Serial.begin(9600);
  8.   irrecv.enableIRIn(); // Start the receiver
  9. }
  10. void loop() {
  11.   if (irrecv.decode(&results)) {
  12.     Serial.println(results.value, HEX);
  13.     irrecv.resume(); // Receive the next value
  14.   }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement