apuntes_Arduino/sensores/ir/ir_receiver2/ir_receiver2.ino
2024-01-16 13:40:01 -03:00

24 lines
682 B
C++

//Code for finding the IR codesC/C++
//Remember to install the IRremote library.
#include <IRremote.h> //including infrared remote header file
int RECV_PIN = 8; // 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("*****************");
}
}