In this tutorial we will know about
the IR sensor and how can set values of remote controls buttons. Through the
values of these buttons we can control any device or circuit remotely. These
values will show at serial monitor of your computer screen. This tutorial will
done and perform by arduino. Value will in HEXA and DECIMAL as you set in
programming HEX, DEC whatever you set. The following components will required.
·
Arduino mega 2560.
·
Any remote (TV, AC, Monitor, MP3 Player)
below are the code for Checking & Obtaining the value of your any REMOTE CONTROL and you upload in arduino after pressing button you will value in HEX.
#include <IRremote.h>
int RECV_PIN = 11;
IRrecv irrecv(RECV_PIN);
decode_results results;
void setup()
{
Serial.begin(9600);
irrecv.enableIRIn(); // Start the receiver
}
void loop() {
if (irrecv.decode(&results)) {
Serial.println(results.value, HEX);
irrecv.resume(); // Receive the next value
}
}
