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
559 B
30 lines
559 B
3 years ago
|
/*
|
||
|
* IRremote: IRrecvDemo - demonstrates receiving IR codes with IRrecv
|
||
|
* An IR detector/demodulator must be connected to the input RECV_PIN.
|
||
|
* Version 0.1 July, 2009
|
||
|
* Copyright 2009 Ken Shirriff
|
||
|
* http://arcfn.com
|
||
|
*/
|
||
|
|
||
|
#include <IRremote.h>
|
||
|
|
||
|
int RECV_PIN = 11;
|
||
|
|
||
|
IRrecv irrecv(RECV_PIN);
|
||
|
|
||
|
decode_results results;
|
||
|
|
||
|
void setup()
|
||
|
{
|
||
|
Serial.begin(9600);
|
||
|
irrecv.enableIRIn(); // Start the receiver
|
||
|
}
|
||
|
|
||
|
void loop() {
|
||
|
if (irrecv.decode(&results)) {
|
||
|
Serial.println(results.value, HEX);
|
||
|
irrecv.resume(); // Receive the next value
|
||
|
}
|
||
|
delay(100);
|
||
|
}
|