Controlling unsupported devices via XBox One

The XBox One has a very useful feature that will turn on all your devices when it's starting up.  Unfortunately, Microsoft has been SLOOOOOW on adding new devices.  Imagine my surprise when I tried configuring my Pyle projector, and none of the remote codes worked.  Well, here's a nerdy way to get around it!

Pick yourself up an Arduino UnoLinkSprite IR shield, the Arudino-IRremote library (drop the IRremote folder in "Documents\Arduino\Libraries") and upload the code below:

#include <IRremote.h>

int RECV_PIN = 11;
IRrecv irrecv(RECV_PIN);

// Depending on the board you use, send pin could be
// different.  For example, the Mega uses digital Pin 9.
IRsend irsend;
decode_results results;

void setup() {
  irrecv.enableIRIn(); // Start the receiver
}

void loop() {
  if (irrecv.decode(&results)) {
    translate();
    irrecv.resume(); // Receive the next value
  }
  delay(100);
}

// Useful for some projectors
void sendTwiceNEC(unsigned long code, int bits) {
  // Delay before sending
  delay(1000);

  irsend.sendNEC(code, bits);
  delay(500);
  irsend.sendNEC(code, bits);
  delay(500);
}

void translate() {
  switch(results.value) {

    case 0x20DF10EF: // LG 47" TV - Power Button
      // Pyle Home PRJLE82H Projector - Power Button
      sendTwiceNEC(0x61D650AF, 32);
      break;
  }

  irrecv.enableIRIn();
  return;
}

What this does, is waits for the power signal from an LG remote, and once it's received, sends two pulses of the Pyle projector's power button (since that's what's required for the shutdown signal on my projector.)

To adapt it to your device, I recommend loading the IRrecvDumpV2 sketch onto your Arduino to get the hex codes you'll need, and plug them into the switch block above.  Or, you can try to extrapolate the information from the LIRC Remote Database.  Also, I'd remove one of the send/delay combinations in sendTwiceNEC if you're controlling a TV/other device.  And if your device doesn't use NEC codes, check out some of the example sketches or IRremote documentation for other manufacturers (like Sony.)

Note - If you find the transmitter isn't working, and you chose a board other than the Uno, check out "IRRemoteInt.h" in the IRremote library for "TIMER_PWM_PIN".  This defaults to digital IO pin 3 for the Uno, but varies for different boards.  Since I used an Arduino Mega 2560, I had to add a jumper on my Linksprite shield from pin 3 to pin 9.