Sketch 1

#include <IRremote.h> // insert IRremote.h library
int RECV_PIN = 11; //define the pin of RECV_PIN 11
IRrecv irrecv(RECV_PIN); //define RECV_PIN as infrared receiver
decode_results results; //define variable results to save the result of infrared receiver
void setup(){
Serial.begin(9600); // configure the baud rate 9600
irrecv.enableIRIn(); //Boot infrared decoding
}
void loop() {
//test if receive decoding data and save it to variable results
if (irrecv.decode(&results)) {
// print data received in a hexadecimal
Serial.println(results.value, HEX);
irrecv.resume(); //wait for the next signal
}
}

Sketch 2

#include <IRremote.h>
int RECV_PIN = 11;
int ledPin = 13; // LED – digital 10
boolean ledState = LOW; // ledState to store the state of LED
IRrecv irrecv(RECV_PIN);
decode_results results;
void setup(){
Serial.begin(9600);
irrecv.enableIRIn();
pinMode(ledPin,OUTPUT); // define LED as output signal
}
void loop() {
if (irrecv.decode(&results)) {
Serial.println(results.value, HEX);
//once receive code from power button, the state of LED is changed from HIGH
//to LOW or LOW to HIGH
if(results.value == 0x10EFD827){
ledState = !ledState; //reverse
digitalWrite(ledPin,ledState); //change the state of LED
}
irrecv.resume();
}
}