Hackster is hosting Hackster Holidays, Finale: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Tuesday!Stream Hackster Holidays, Finale on Tuesday!
Amr Saleh
Published

Universal Remote Control

Control everything from your phone

Full instructions provided8,588
Universal Remote Control

Things used in this project

Story

Read more

Code

Untitled file

Arduino
#include <OneSheeld.h>
#include <IRremote.h>
IRsend irsend;
void setup() 
{
  OneSheeld.begin();
}

void loop(){  if(Keypad.isRowPressed(0) && Keypad.isColumnPressed(0))
  {
    irsend.sendNEC(0x20DF10EF, 32);
  }
  else if(Keypad.isRowPressed(0) && Keypad.isColumnPressed(1))
  {
    irsend.sendNEC(0x20DFC03F, 32);
  }
   else if(Keypad.isRowPressed(0) && Keypad.isColumnPressed(2))
  {
    irsend.sendNEC(0x20DF40BF, 32);
  }
   else if(Keypad.isRowPressed(1) && Keypad.isColumnPressed(1))
  {
    irsend.sendNEC(0x41048B7, 32);
  }
  else if(Keypad.isRowPressed(1) && Keypad.isColumnPressed(0))
  {
    irsend.sendNEC(0x410C837, 32);
  }
  else if(Keypad.isRowPressed(2) && Keypad.isColumnPressed(0))
  {
      for (int i = 0; i < 3; i++) {
      irsend.sendSony(0xa81, 12); // Sony TV power code
      delay(40);
    }
  }
}

Github

https://github.com/shirriff/Arduino-IRremote

Codebender

https://codebender.cc/sketch:55268

Credits

Ashraf Nabil

Posted by Amr Saleh

Comments