apuntes_Arduino/sensores/ir/ir_receiver2/ir_receiver2.ino
jp.av.dev b6bc7991dc continuacion de reestructuracion
pendientes readmes y
modificar tests/
2022-04-04 02:37:38 -04:00

28 lines
660 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("*****************");
}
}