DEVICE CONTROL USING TV REMOTE

Photo of author

By Jackson Taylor

YouTube video
#include <IRremote.h>
int RECV_PIN = 11;
IRrecv irrecv(RECV_PIN);
decode_results results;
int led = 13;
void setup()
{
pinMode(led, OUTPUT);
  Serial.begin(9600);
  irrecv.enableIRIn(); // Start the receiver
}
void loop()
{
  if (irrecv.decode(&results))
  {
   if(results.value==16713975)//checks a value in my remote.look serial monitor for you remote                                                                                                                                   //value
{
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);           // wait for a second
  digitalWrite(led, LOW);   // turn the LED off by making the voltage LOW
  delay(1000);
}
  Serial.println(results.value);
  irrecv.resume(); // Receive the next value
  }
}

Download ir header from https://github.com/shirriff/Arduino-IRremote

See also
READING AN INPUT IN PYTHON