apuntes_Arduino/sensores/ir/ir_receiver2/ir_receiver2.ino
2022-04-04 17:41:38 -04:00

24 lines
683 B
C++
Executable File

//Code for finding the IR codesC/C++
//Remember to install the IRremote library.
#include <IRremote.h> //including infrared remote header file
int RECV_PIN = 11; // the pin where you connect the output pin of IR sensor
IRrecv irrecv(RECV_PIN);
decode_results results;
void setup() {
Serial.begin(9600);
irrecv.enableIRIn();
}
void loop() {
if (irrecv.decode(&results)) {
Serial.println(" ");
Serial.print("Code: ");
Serial.println(results.value); //prints the value a a button press
Serial.println(" ");
irrecv.resume(); // Receive the next value
Serial.println("*****************");
}
}