// IR TRANSMITTER AND RECEIVER USING DECLARATION VARIABLE METHOD
#include <IRremote.h>
int signal = 2;
IRrecv communication(signal);
void setup() {
Serial.begin(9600);
communication.enableIRIn();
//IrReceiver.begin(signal);
// put your setup code here, to run once:
}
void loop() {
if (communication.decode())
{
Serial.println(communication.decodedIRData.command);
communication.resume();
}
// put your main code here, to run repeatedly:
}
// IR TRANSMITTER AND RECEIVER USING STANDARD DECLARATION METHOD
/*#include <IRremote.h>
int ir_pin = 2;
void setup()
{
Serial.begin();
IrReceiver.begin(ir_pin);
}
void loop()
{
if(IrReceiver.decode())
{
Serial.println(IrReceiver.decodedIRData.command);
IrReceiver.resume();
}
}*/