#include <IRremote.h>

int receiverpin = 3;

int LED1 = 4;
int LED2 = 5;
int LED3 = 6;

#define key1 0xFF30CF
#define key2 0xFF18E7
#define key3 0xFF7A85
#define key4 0xFF10EF
#define key5 0xFF38C7

IRrecv irrecv(receiverpin);
decode_results results;

void setup() {
  pinMode(receiverpin, INPUT);
  irrecv.enableIRIn();
  pinMode(LED1, OUTPUT);
  pinMode(LED2, OUTPUT);
  pinMode(LED3, OUTPUT);
}

void loop() {
  if (irrecv.decode(&results)) {
    switch (results.value) {
      case key1:
        digitalWrite(LED2, LOW);
        digitalWrite(LED3, LOW);
        digitalWrite(LED1, HIGH);
        break;
      case key2:
        digitalWrite(LED1, LOW);
        digitalWrite(LED3, LOW);
        digitalWrite(LED2, HIGH);
        break;
      case key3:
        digitalWrite(LED1, LOW);
        digitalWrite(LED2, LOW);
        digitalWrite(LED3, HIGH);
        break;
      case key4:
        digitalWrite(LED1, HIGH);
        digitalWrite(LED2, HIGH);
        digitalWrite(LED3, HIGH);
        break;
      case key5:
        digitalWrite(LED1, LOW);
        digitalWrite(LED2, LOW);
        digitalWrite(LED3, LOW);
      default:;
    }
    irrecv.resume();
  }
}
