Main idea about this project. Is learn how to incorporate some Arduino features to control external infrared devices.
Single ARDUINO NANO to control your APPLE TV trough Android APP and HC-05 bluetooth device.
DIY easier ARDUINO remote control with ANDROID App
#include <IRLib.h>
IRsend My_Sender; // Pin #3
#include <SoftwareSerial.h>
SoftwareSerial BT(10,11);
char a;
#define U 0x77E1D0DD // each 20 degrees greater
#define D 0x77E1B0DD
#define L 0x77E110DD
#define R 0x77E1E0DD
#define Ok/P 0x77E1BADD
#define Menu 0x77E140DD
void setup()
{
BT.begin(9600);
}
void loop() {
if (BT.available()){
a=(BT.read());
if (a=='u'){ // Botón UP
delay(50);
My_Sender.send(1,0x77E1D0DD,32);
delay(200);
}
if (a=='l'){ // Botón LEFT
delay(50);
My_Sender.send(1,0x77E110DD,32);
delay(200);
}
if (a=='o'){ // Botón OK
delay(50);
My_Sender.send(1,0x77E1BADD,32);
delay(200);
}
if (a=='r'){ // Botón RIGHT
delay(50);
My_Sender.send(1,0x77E1E0DD,32);
delay(200);
}
if (a=='d'){ // Botón DOWN
delay(50);
My_Sender.send(1,0x77E1B0DD,32);
delay(200);
}
if (a=='m'){ // Botón MENU
delay(50);
My_Sender.send(1,0x77E140DD,32);
delay(200);
}
if (a=='p'){ // Botón PLAY PAUSA
delay(50);
My_Sender.send(1,0x77E1BADD,32);
delay(200);
}
}
}