2021-01-05 00:15:16 -03:00
|
|
|
//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("*****************");
|
|
|
|
}
|
|
|
|
}
|
2021-01-05 00:30:20 -03:00
|
|
|
|