#include <IRremote.h>

const int RECV_PIN = 7;
IRrecv irrecv(RECV_PIN);
decode_results results;

void setup()
{
  Serial.begin(9600);
  irrecv.enableIRIn(); // Start the receiver
  irrecv.blink13(true); // Blink when IR signal received?
  while(!Serial) {;} // Wait for Serial Connection...
  Serial.println("Connected!");
}

void loop() {
  if (irrecv.decode(&results)) {
    switch (results.decode_type){
      case NEC: Serial.print("NEC: "); break ;
      case SONY: Serial.print("SONY: "); break ;
      case RC5: Serial.print("RC5: "); break ;
      case RC6: Serial.print("RC6: "); break ;
      case DISH: Serial.print("DISH: "); break ;
      case SHARP: Serial.print("SHARP: "); break ;
      case JVC: Serial.print("JVC: "); break ;
      case SANYO: Serial.print("SANYO: "); break ;
      case MITSUBISHI: Serial.print("MITSUBISHI: "); break ;
      case SAMSUNG: Serial.print("SAMSUNG: "); break ;
      case LG: Serial.print("LG: "); break ;
      case WHYNTER: Serial.print("WHYNTER: "); break ;
      case AIWA_RC_T501: Serial.print("AIWA_RC_T501: "); break ;
      case PANASONIC: Serial.print("PANASONIC: "); break ;
      case DENON: Serial.print("DENON: "); break ;
    default:
      case UNKNOWN: Serial.print("UNKNOWN: "); break ;
    }
    Serial.print(results.value, HEX);
    // Added # of bits in decode type
    Serial.print(" ");
    Serial.println(results.bits);
    irrecv.resume(); // Receive the next value
  }
}
