/*
  Program that allows to display on the serial monitor the code corresponding
  to the button pressed on a remote control.
  Requires the installation of the IRremote library.
*/

#include <IRremote.h>   

int SENSOR = 2;           
IRrecv irrecv(SENSOR);   
decode_results code;    

void setup() { 
  Serial.begin(9600);     
  irrecv.enableIRIn();    
} 

void loop() { 
  if (irrecv.decode(&code)) {   
    Serial.println(code.value, HEX);  
    irrecv.resume();     
  }
  delay (100);      
}
