Bluetooth remote control for TV on arduino
We continue to make different smart / smart / bluetooth devices on arduino. In past articles, I talked about a bluetooth machine and a bluetooth voltmeter . Today we will talk about something like a bluetooth remote control for a TV. Voting for the most successful name for such a device will be at the end of the article, but first I suggest watching a video of how this device works.
In the article I will tell you why, how and from what this device was assembled, about the advantages and disadvantages of its use, as well as a few words about existing analogs.
First of all, why I decided to make such a device. This, it seems to me, is a very important question, because most of the friends to whom I talked about this device are asked primarily not about how it works, but about why I made this device. It all started with the fact that after a long break due to the advent of high-speed Internet, I decided to turn on the TV and find out if there was anything out there for the few years that I did not turn it on. It turns out changed. First of all, I had 63 channels on the TV, instead of the 7-8 channels that were before. This seemed like good news until I realized that I can only watch as many channels from these 63 as I can remember their numbers. That is, if you don’t remember which channel Discovery is configured on, you can’t actually see it, until you scroll through the channels in order. Even if you remember the number of the desired channel, you still have to contrive to press 2 buttons of the remote control for a certain (short) time, hitting sometimes deleted buttons of the remote control in the dark. In general, this is hell, and so I decided to do something about it.
Now let's go directly to the device that turned out to be done. The circuit is quite simple:
Components:
Arduino nano
Bluetooth Module
IR LED
The principle of operation is also very simple. We launch the application on a smartphone or tablet, it sends information with a channel number to a pre-paired bluetooth module. This module transmits the channel number to the arduino, and the arduino generates the desired signal by 3 pins, thereby simulating a standard remote control. I must say that the topic of controlling various household appliances via the IR channel with arduino is well developed, and there is an IRremote library for arduino, which supports most televisions and other equipment with IR control.
Now to the manufacturing process of the bluetooth remote. To find out what arduino signals should send to the TV, you must first scan the standard remote control using the standard sketch of the IRremote library and the IR receiver . The remote control from my LG TV turned out to be scanned right away. I registered these codes in
As it turned out later, these codes apply to other LG TVs.
A little later I made the same bluetooth remote control for a Sony TV. The button codes of Sony remote controls are also easy to read, but you need to know that with this brand each signal is repeated 3 times, and the standard sketch for reading the IRremote library does not “notice” it. Therefore, in the sketch you need to repeat them 3 times. Sketch for working with a Sony TV
Video demonstrating robots with Sony:
With samsung TVs, the situation is a little more complicated. the IRremote library does not recognize the signals of their consoles, so you just have to send them in the same form in which they come in RAW format.
Demonstration of work here:
We figured out the arduino, now go to Android. The application is easiest to make using the visual development environment of Android applications App Inventor 2, although here it is more convenient for someone. The application should have simple functionality: connect to the paired bluetooth module and send the channel number to which you want to switch to it. The design of my application turned out to be very simple.
If someone wants to make the same application, I shot a video in which I explain in detail how and what to do for this. Even someone who has never programmed for android can figure it out. (to view you need to go to YouTube)
Now a few words about the advantages and disadvantages of my bluetooth remote control. The usefulness of this device for society raises serious doubts, however, like the usefulness of other smart / smart / bluetooth devices, such as, for example, a “smart” roulette , a Bluetooth sticker and a “smart” fridge magnet . But personally, the bluetooth remote control makes my life a little easier. If before I did not watch TV at all, now I turn it on sometimes, and only from a smartphone or tablet, depending on what is at hand.
In general, with such a scheme, you can control not only the TV, but all the devices that are controlled, but this is a slightly different story.
PS A collection of over 100 instructional materials on arduino for beginners and pros here
PPS Online Arduino Gicktime course here.
And I want to finish the survey that I promised at the beginning of the article.
In the article I will tell you why, how and from what this device was assembled, about the advantages and disadvantages of its use, as well as a few words about existing analogs.
First of all, why I decided to make such a device. This, it seems to me, is a very important question, because most of the friends to whom I talked about this device are asked primarily not about how it works, but about why I made this device. It all started with the fact that after a long break due to the advent of high-speed Internet, I decided to turn on the TV and find out if there was anything out there for the few years that I did not turn it on. It turns out changed. First of all, I had 63 channels on the TV, instead of the 7-8 channels that were before. This seemed like good news until I realized that I can only watch as many channels from these 63 as I can remember their numbers. That is, if you don’t remember which channel Discovery is configured on, you can’t actually see it, until you scroll through the channels in order. Even if you remember the number of the desired channel, you still have to contrive to press 2 buttons of the remote control for a certain (short) time, hitting sometimes deleted buttons of the remote control in the dark. In general, this is hell, and so I decided to do something about it.
Now let's go directly to the device that turned out to be done. The circuit is quite simple:
Components:
Arduino nano
Bluetooth Module
IR LED
The principle of operation is also very simple. We launch the application on a smartphone or tablet, it sends information with a channel number to a pre-paired bluetooth module. This module transmits the channel number to the arduino, and the arduino generates the desired signal by 3 pins, thereby simulating a standard remote control. I must say that the topic of controlling various household appliances via the IR channel with arduino is well developed, and there is an IRremote library for arduino, which supports most televisions and other equipment with IR control.
Now to the manufacturing process of the bluetooth remote. To find out what arduino signals should send to the TV, you must first scan the standard remote control using the standard sketch of the IRremote library and the IR receiver . The remote control from my LG TV turned out to be scanned right away. I registered these codes in
sketch
#include
IRsend irsend;
unsigned long a;
void setup () {
Serial.begin (9600);
Serial.setTimeout (4);
pinMode (ledPin, OUTPUT);
}
void S1 () {irsend.sendNEC (0x20DF8877, 32); delay (200);}
void S2 () {irsend.sendNEC (0x20DF48B7, 32); delay (200);}
void S3 () {irsend.sendNEC ( 0x20DFC837, 32); delay (200);}
void S4 () {irsend.sendNEC (0x20DF28D7, 32); delay (200);}
void S5 () {irsend.sendNEC (0x20DFA857, 32); delay (200); }
void S6 () {irsend.sendNEC (0x20DF6897, 32); delay (200);}
void S7 () {irsend.sendNEC (0x20DFE817, 32); delay (200);}
void S8 () {irsend.sendNEC ( 0x20DF18E7, 32); delay (200);}
void S9 () {irsend.sendNEC (0x20DF9867, 32); delay (200);}
void S0 () {irsend.sendNEC (0x20DF08F7, 32); delay (200);}
void Son () {irsend.sendNEC (0x20DF10EF, 32);}
void loop ()
{
if (Serial.available ())
{a = Serial.parseInt ();
if (a == 1) {S1 ();}
if (a == 2) {S2 ();}
if (a == 3) {S3 ();}
if (a == 4) {S4 () ;}
if (a == 5) {S5 ();}
if (a == 6) {S6 ();}
if (a == 7) {S7 ();}
if (a == 8) {S8 ();}
if (a == 9) {S9 ();}
if (a == 10) {S1 (); S0 ();}
if (a == 11) {S1 (); S1 (); }
if (a == 12) {S1 (); S2 ();}
if (a == 13) {S1 (); S3 ();}
if (a == 14) {S1 (); S4 () ;}
if (a == 15) {S1 (); S5 ();}
if (a == 16) {S1 (); S6 ();}
if (a == 17) {S1 (); S7 ( );}
if (a == 18) {S1 (); S8 ();}
if (a == 19) {S1 (); S9 ();}
if (a == 20) {S2 (); S0 ();}
if (a == 21) {S2 (); S1 (); }
if (a == 22) {S2 (); S2 ();}
if (a == 23) {S2 (); S3 ();}
if (a == 24) {S2 (); S4 () ;}
if (a == 25) {S2 (); S5 ();}
if (a == 26) {S2 (); S6 ();}
if (a == 27) {S2 (); S7 ( );}
if (a == 28) {S2 (); S8 ();}
if (a == 29) {S2 (); S9 ();}
if (a == 30) {S3 (); S0 ();}
if (a == 31) {S3 (); S1 ();}
if (a == 32) {S3 (); S2 ();}
if (a == 33) {S3 (); S3 ();}
if (a == 34) {S3 (); S4 ();}
if (a == 35) {S3 (); S5 ();}
if (a == 36) {S3 () ; S6 ();}
if (a == 37) {S3 (); S7 ();}
if (a == 38) {S3 (); S8 ();}
if (a == 39) {S3 ( ); S9 ();}
if (a == 40) {S4 (); S0 ();}
if (a == 41) {S4 (); S1 ();}
if (a == 42) {S4 (); S2 ();}
if (a == 43) {S4 (); S3 ();}
if (a == 44) {S4 (); S4 (); }
if (a == 45) {S4 (); S5 ();}
if (a == 46) {S4 (); S6 ();}
if (a == 47) {S4 (); S7 () ;}
if (a == 48) {S4 (); S8 ();}
if (a == 49) {S4 (); S9 ();}
if (a == 50) {S5 (); S0 ( );}
if (a == 51) {S5 (); S1 ();}
if (a == 52) {S5 (); S2 ();}
if (a == 53) {S5 (); S3 ();}
if (a == 54) {S5 (); S4 ();}
if (a == 55) {S5 (); S5 ();}
if (a == 56) {S5 (); S6 ();}
if (a == 57) {S5 (); S7 ();}
if (a == 58) {S5 (); S8 ();}
if (a == 59) {S5 () ; S9 ();}
if (a == 60) {S6 (); S0 ();}
if (a == 61) {S6 (); S1 ();}
if (a == 62) {S6 ( ); S2 ();}
if (a == 63) {S6 (); S3 ();}
if (a == 64) {S6 (); S4 ();}
if (a == 65) {S6 (); S5 ();}
if (a == 66) {Son ();}
if (a == 67) {irsend.sendNEC (0x807F48B7, 32);} // add sound
if (a == 68) {irsend.sendNEC (0x807FC837, 32);} // decrease the sound
}
}
IRsend irsend;
unsigned long a;
void setup () {
Serial.begin (9600);
Serial.setTimeout (4);
pinMode (ledPin, OUTPUT);
}
void S1 () {irsend.sendNEC (0x20DF8877, 32); delay (200);}
void S2 () {irsend.sendNEC (0x20DF48B7, 32); delay (200);}
void S3 () {irsend.sendNEC ( 0x20DFC837, 32); delay (200);}
void S4 () {irsend.sendNEC (0x20DF28D7, 32); delay (200);}
void S5 () {irsend.sendNEC (0x20DFA857, 32); delay (200); }
void S6 () {irsend.sendNEC (0x20DF6897, 32); delay (200);}
void S7 () {irsend.sendNEC (0x20DFE817, 32); delay (200);}
void S8 () {irsend.sendNEC ( 0x20DF18E7, 32); delay (200);}
void S9 () {irsend.sendNEC (0x20DF9867, 32); delay (200);}
void S0 () {irsend.sendNEC (0x20DF08F7, 32); delay (200);}
void Son () {irsend.sendNEC (0x20DF10EF, 32);}
void loop ()
{
if (Serial.available ())
{a = Serial.parseInt ();
if (a == 1) {S1 ();}
if (a == 2) {S2 ();}
if (a == 3) {S3 ();}
if (a == 4) {S4 () ;}
if (a == 5) {S5 ();}
if (a == 6) {S6 ();}
if (a == 7) {S7 ();}
if (a == 8) {S8 ();}
if (a == 9) {S9 ();}
if (a == 10) {S1 (); S0 ();}
if (a == 11) {S1 (); S1 (); }
if (a == 12) {S1 (); S2 ();}
if (a == 13) {S1 (); S3 ();}
if (a == 14) {S1 (); S4 () ;}
if (a == 15) {S1 (); S5 ();}
if (a == 16) {S1 (); S6 ();}
if (a == 17) {S1 (); S7 ( );}
if (a == 18) {S1 (); S8 ();}
if (a == 19) {S1 (); S9 ();}
if (a == 20) {S2 (); S0 ();}
if (a == 21) {S2 (); S1 (); }
if (a == 22) {S2 (); S2 ();}
if (a == 23) {S2 (); S3 ();}
if (a == 24) {S2 (); S4 () ;}
if (a == 25) {S2 (); S5 ();}
if (a == 26) {S2 (); S6 ();}
if (a == 27) {S2 (); S7 ( );}
if (a == 28) {S2 (); S8 ();}
if (a == 29) {S2 (); S9 ();}
if (a == 30) {S3 (); S0 ();}
if (a == 31) {S3 (); S1 ();}
if (a == 32) {S3 (); S2 ();}
if (a == 33) {S3 (); S3 ();}
if (a == 34) {S3 (); S4 ();}
if (a == 35) {S3 (); S5 ();}
if (a == 36) {S3 () ; S6 ();}
if (a == 37) {S3 (); S7 ();}
if (a == 38) {S3 (); S8 ();}
if (a == 39) {S3 ( ); S9 ();}
if (a == 40) {S4 (); S0 ();}
if (a == 41) {S4 (); S1 ();}
if (a == 42) {S4 (); S2 ();}
if (a == 43) {S4 (); S3 ();}
if (a == 44) {S4 (); S4 (); }
if (a == 45) {S4 (); S5 ();}
if (a == 46) {S4 (); S6 ();}
if (a == 47) {S4 (); S7 () ;}
if (a == 48) {S4 (); S8 ();}
if (a == 49) {S4 (); S9 ();}
if (a == 50) {S5 (); S0 ( );}
if (a == 51) {S5 (); S1 ();}
if (a == 52) {S5 (); S2 ();}
if (a == 53) {S5 (); S3 ();}
if (a == 54) {S5 (); S4 ();}
if (a == 55) {S5 (); S5 ();}
if (a == 56) {S5 (); S6 ();}
if (a == 57) {S5 (); S7 ();}
if (a == 58) {S5 (); S8 ();}
if (a == 59) {S5 () ; S9 ();}
if (a == 60) {S6 (); S0 ();}
if (a == 61) {S6 (); S1 ();}
if (a == 62) {S6 ( ); S2 ();}
if (a == 63) {S6 (); S3 ();}
if (a == 64) {S6 (); S4 ();}
if (a == 65) {S6 (); S5 ();}
if (a == 66) {Son ();}
if (a == 67) {irsend.sendNEC (0x807F48B7, 32);} // add sound
if (a == 68) {irsend.sendNEC (0x807FC837, 32);} // decrease the sound
}
}
As it turned out later, these codes apply to other LG TVs.
A little later I made the same bluetooth remote control for a Sony TV. The button codes of Sony remote controls are also easy to read, but you need to know that with this brand each signal is repeated 3 times, and the standard sketch for reading the IRremote library does not “notice” it. Therefore, in the sketch you need to repeat them 3 times. Sketch for working with a Sony TV
here
#include
IRsend irsend;
int ledPin = 13;
unsigned long a;
void setup () {
Serial.begin (9600);
Serial.setTimeout (4);
pinMode (ledPin, OUTPUT);
}
void S1 () {irsend.sendSony (0x10, 12); delay (100); irsend.sendSony (0x10, 12); delay (100); irsend.sendSony (0x10, 12); delay (1000);}
void S2 () {irsend.sendSony (0x810, 12); delay (100); irsend.sendSony (0x810, 12); delay (100); irsend.sendSony (0x810, 12); delay (1000);}
void S3 ( ) {irsend.sendSony (0x410, 12); delay (100); irsend.sendSony (0x410, 12); delay (100); irsend.sendSony (0x410, 12); delay (1000);}
void S4 () { irsend.sendSony (0xC10, 12); delay (100); irsend.sendSony (0xC10, 12); delay (100); irsend.sendSony (0xC10, 12); delay (1000);}
void S5 () {irsend.sendSony (0x210, 12); delay (100); irsend.sendSony (0x210, 12); delay (100); irsend.sendSony (0x210, 12); delay (1000);}
void S6 () {irsend.sendSony (0xA10, 12); delay (100); irsend.sendSony (0xA10, 12); delay (100); irsend.sendSony (0xA10, 12); delay (1000);}
void S7 () {irsend.sendSony (0x610, 12); delay (100); irsend.sendSony (0x610, 12); delay (100); irsend.sendSony (0x610, 12); delay (1000);}
void S8 () {irsend .sendSony (0xE10, 12); delay (100); irsend.sendSony (0xE10, 12); delay (100); irsend.sendSony (0xE10, 12); delay (1000);}
void S9 () {irsend.sendSony (0x110, 12); delay (100); irsend.sendSony (0x110, 12); delay (100); irsend.sendSony (0x110, 12); delay (1000);}
void S0 () {irsend.sendSony (0x910 , 12); delay (100); irsend.sendSony (0x910, 12); delay (100); irsend.sendSony (0x910, 12); delay (1000);}
void Son () {irsend.sendSony (0xA90, 12); delay (100); irsend.sendSony (0xA90, 12); delay (100); irsend.sendSony (0xA90, 12); delay (1000);}
void loop ()
{
if (Serial.available ())
{a = Serial.parseInt ();
if (a == 1) {S1 ();}
if (a == 2) {S2 ();}
if (a == 3) {S3 ();}
if (a == 4) {S4 () ;}
if (a == 5) {S5 ();}
if (a == 6) {S6 ();}
if (a == 7) {S7 ();}
if (a == 8) {S8 ();}
if (a == 9) {S9 ();}
if (a == 10) {S1 (); S0 ();}
if (a == 11) {S1 (); S1 (); }
if (a == 12) {S1 (); S2 ();}
if (a == 13) {S1 (); S3 ();}
if (a == 14) {S1 (); S4 () ;}
if (a == 15) {S1 (); S5 ();}
if (a == 16) {S1 (); S6 ();}
if (a == 17) {S1 (); S7 ( );}
if (a == 18) {S1 (); S8 ();}
if (a == 19) {S1 (); S9 ();}
if (a == 20) {S2 (); S0 (); }
if (a == 21) {S2 (); S1 ();}
if (a == 22) {S2 (); S2 ();}
if (a == 23) {S2 (); S3 () ;}
if (a == 24) {S2 (); S4 ();}
if (a == 25) {S2 (); S5 ();}
if (a == 26) {S2 (); S6 ( );}
if (a == 27) {S2 (); S7 ();}
if (a == 28) {S2 (); S8 ();}
if (a == 29) {S2 (); S9 ();}
if (a == 30) {S3 (); S0 ();}
if (a == 31) {S3 (); S1 ();}
if (a == 32) {S3 (); S2 ();}
if (a == 33) {S3 (); S3 ();}
if (a == 34) {S3 (); S4 ();}
if (a == 35) {S3 () ; S5 ();}
if (a == 36) {S3 (); S6 ();}
if (a == 37) {S3 (); S7 ();}
if (a == 38) {S3 ( ); S8 ();}
if (a == 39) {S3 (); S9 ();}
if (a == 40) {S4 (); S0 ();}
if (a == 41) {S4 (); S1 ();}
if (a == 42) {S4 (); S2 ();}
if (a == 43) {S4 (); S3 (); }
if (a == 44) {S4 (); S4 ();}
if (a == 45) {S4 (); S5 ();}
if (a == 46) {S4 (); S6 () ;}
if (a == 47) {S4 (); S7 ();}
if (a == 48) {S4 (); S8 ();}
if (a == 49) {S4 (); S9 ( );}
if (a == 50) {S5 (); S0 ();}
if (a == 51) {S5 (); S1 ();}
if (a == 52) {S5 (); S2 ();}
if (a == 53) {S5 (); S3 ();}
if (a == 54) {S5 (); S4 ();}
if (a == 55) {S5 (); S5 ();}
if (a == 56) {S5 (); S6 ();}
if (a == 57) {S5 (); S7 ();}
if (a == 58) {S5 () ; S8 ();}
if (a == 59) {S5 (); S9 ();}
if (a == 60) {S6 (); S0 ();}
if (a == 61) {S6 ( ); S1 ();}
if (a == 62) {S6 (); S2 ();}
if (a == 63) {S6 (); S3 ();}
if (a == 64) {S6 (); S4 ();}
if (a == 65) {
irsend.sendSony (0x290, 12); // Sony TV mute code
delay (100);
irsend.sendSony (0x290, 12); // Sony TV mute code
delay (100);
irsend.sendSony (0x290, 12); // Sony TV mute code
delay (100);
}
if (a == 66) {
irsend.sendSony (0xa90, 12); // Sony TV power code
delay (100);
irsend.sendSony (0xa90, 12); // Sony TV power code
delay (100);
irsend.sendSony (0xa90, 12); // Sony TV power code
delay (100);
}
if (a == 67) {
irsend.sendSony (0x490, 12); // Sony TV vol +
delay (100);
irsend.sendSony (0x490, 12); // Sony T
delay (100);
irsend.sendSony (0x490, 12); // Sony TV vol +
delay (100);
}
if (a == 68) {
irsend.sendSony (0xc90, 12); // Sony TV vol-
delay (100);
irsend.sendSony (0xc90, 12); // Sony T
delay (100);
irsend.sendSony (0xc90, 12); // Sony TV vol-
delay (100);
}
if (a == 69) {S6 (); S9 ();}
if (a == 70) {S7 (); S0 ();}
if (a == 71) {S7 (); S1 () ;}
if (a == 72) {S7 (); S2 ();}
if (a == 73) {S7 (); S3 ();}
if (a == 74) {S7 (); S4 ( );}
if (a == 75) {S7 (); S5 ();}
if (a == 76) {S7 (); S6 ();}
if (a == 77) {S7 (); S7 ();}
if (a == 78) {S7 (); S8 ();}
if (a == 79) {S7 (); S9 ();}
if (a == 80) {S8 (); S0 ();}
if (a == 81) {S8 (); S1 ();}
if (a == 82) {S8 (); S2 ();}
if (a == 83) {S8 (); S3 ();}
if (a == 84) {S8 (); S4 (); }
if (a == 85) {S8 (); S5 ();}
if (a == 86) {S8 (); S6 ();}
if (a == 87) {S8 (); S7 () ;}
if (a == 88) {S8 (); S8 ();}
if (a == 89) {S8 (); S9 ();}
if (a == 90) {S9 (); S0 ( );}
if (a == 91) {S9 (); S1 ();}
if (a == 92) {S9 (); S2 ();}
if (a == 93) {S9 (); S3 ();}
if (a == 94) {S9 (); S4 ();}
if (a == 95) {S9 (); S5 ();}
if (a == 96) {S9 (); S6 ();}
if (a == 97) {S9 (); S7 ();}
if (a == 98) {S9 (); S8 ();}
if (a == 99) {S9 () ; S9 ();}
if (a == 100) {Son ();}
}
}
IRsend irsend;
int ledPin = 13;
unsigned long a;
void setup () {
Serial.begin (9600);
Serial.setTimeout (4);
pinMode (ledPin, OUTPUT);
}
void S1 () {irsend.sendSony (0x10, 12); delay (100); irsend.sendSony (0x10, 12); delay (100); irsend.sendSony (0x10, 12); delay (1000);}
void S2 () {irsend.sendSony (0x810, 12); delay (100); irsend.sendSony (0x810, 12); delay (100); irsend.sendSony (0x810, 12); delay (1000);}
void S3 ( ) {irsend.sendSony (0x410, 12); delay (100); irsend.sendSony (0x410, 12); delay (100); irsend.sendSony (0x410, 12); delay (1000);}
void S4 () { irsend.sendSony (0xC10, 12); delay (100); irsend.sendSony (0xC10, 12); delay (100); irsend.sendSony (0xC10, 12); delay (1000);}
void S5 () {irsend.sendSony (0x210, 12); delay (100); irsend.sendSony (0x210, 12); delay (100); irsend.sendSony (0x210, 12); delay (1000);}
void S6 () {irsend.sendSony (0xA10, 12); delay (100); irsend.sendSony (0xA10, 12); delay (100); irsend.sendSony (0xA10, 12); delay (1000);}
void S7 () {irsend.sendSony (0x610, 12); delay (100); irsend.sendSony (0x610, 12); delay (100); irsend.sendSony (0x610, 12); delay (1000);}
void S8 () {irsend .sendSony (0xE10, 12); delay (100); irsend.sendSony (0xE10, 12); delay (100); irsend.sendSony (0xE10, 12); delay (1000);}
void S9 () {irsend.sendSony (0x110, 12); delay (100); irsend.sendSony (0x110, 12); delay (100); irsend.sendSony (0x110, 12); delay (1000);}
void S0 () {irsend.sendSony (0x910 , 12); delay (100); irsend.sendSony (0x910, 12); delay (100); irsend.sendSony (0x910, 12); delay (1000);}
void Son () {irsend.sendSony (0xA90, 12); delay (100); irsend.sendSony (0xA90, 12); delay (100); irsend.sendSony (0xA90, 12); delay (1000);}
void loop ()
{
if (Serial.available ())
{a = Serial.parseInt ();
if (a == 1) {S1 ();}
if (a == 2) {S2 ();}
if (a == 3) {S3 ();}
if (a == 4) {S4 () ;}
if (a == 5) {S5 ();}
if (a == 6) {S6 ();}
if (a == 7) {S7 ();}
if (a == 8) {S8 ();}
if (a == 9) {S9 ();}
if (a == 10) {S1 (); S0 ();}
if (a == 11) {S1 (); S1 (); }
if (a == 12) {S1 (); S2 ();}
if (a == 13) {S1 (); S3 ();}
if (a == 14) {S1 (); S4 () ;}
if (a == 15) {S1 (); S5 ();}
if (a == 16) {S1 (); S6 ();}
if (a == 17) {S1 (); S7 ( );}
if (a == 18) {S1 (); S8 ();}
if (a == 19) {S1 (); S9 ();}
if (a == 20) {S2 (); S0 (); }
if (a == 21) {S2 (); S1 ();}
if (a == 22) {S2 (); S2 ();}
if (a == 23) {S2 (); S3 () ;}
if (a == 24) {S2 (); S4 ();}
if (a == 25) {S2 (); S5 ();}
if (a == 26) {S2 (); S6 ( );}
if (a == 27) {S2 (); S7 ();}
if (a == 28) {S2 (); S8 ();}
if (a == 29) {S2 (); S9 ();}
if (a == 30) {S3 (); S0 ();}
if (a == 31) {S3 (); S1 ();}
if (a == 32) {S3 (); S2 ();}
if (a == 33) {S3 (); S3 ();}
if (a == 34) {S3 (); S4 ();}
if (a == 35) {S3 () ; S5 ();}
if (a == 36) {S3 (); S6 ();}
if (a == 37) {S3 (); S7 ();}
if (a == 38) {S3 ( ); S8 ();}
if (a == 39) {S3 (); S9 ();}
if (a == 40) {S4 (); S0 ();}
if (a == 41) {S4 (); S1 ();}
if (a == 42) {S4 (); S2 ();}
if (a == 43) {S4 (); S3 (); }
if (a == 44) {S4 (); S4 ();}
if (a == 45) {S4 (); S5 ();}
if (a == 46) {S4 (); S6 () ;}
if (a == 47) {S4 (); S7 ();}
if (a == 48) {S4 (); S8 ();}
if (a == 49) {S4 (); S9 ( );}
if (a == 50) {S5 (); S0 ();}
if (a == 51) {S5 (); S1 ();}
if (a == 52) {S5 (); S2 ();}
if (a == 53) {S5 (); S3 ();}
if (a == 54) {S5 (); S4 ();}
if (a == 55) {S5 (); S5 ();}
if (a == 56) {S5 (); S6 ();}
if (a == 57) {S5 (); S7 ();}
if (a == 58) {S5 () ; S8 ();}
if (a == 59) {S5 (); S9 ();}
if (a == 60) {S6 (); S0 ();}
if (a == 61) {S6 ( ); S1 ();}
if (a == 62) {S6 (); S2 ();}
if (a == 63) {S6 (); S3 ();}
if (a == 64) {S6 (); S4 ();}
if (a == 65) {
irsend.sendSony (0x290, 12); // Sony TV mute code
delay (100);
irsend.sendSony (0x290, 12); // Sony TV mute code
delay (100);
irsend.sendSony (0x290, 12); // Sony TV mute code
delay (100);
}
if (a == 66) {
irsend.sendSony (0xa90, 12); // Sony TV power code
delay (100);
irsend.sendSony (0xa90, 12); // Sony TV power code
delay (100);
irsend.sendSony (0xa90, 12); // Sony TV power code
delay (100);
}
if (a == 67) {
irsend.sendSony (0x490, 12); // Sony TV vol +
delay (100);
irsend.sendSony (0x490, 12); // Sony T
delay (100);
irsend.sendSony (0x490, 12); // Sony TV vol +
delay (100);
}
if (a == 68) {
irsend.sendSony (0xc90, 12); // Sony TV vol-
delay (100);
irsend.sendSony (0xc90, 12); // Sony T
delay (100);
irsend.sendSony (0xc90, 12); // Sony TV vol-
delay (100);
}
if (a == 69) {S6 (); S9 ();}
if (a == 70) {S7 (); S0 ();}
if (a == 71) {S7 (); S1 () ;}
if (a == 72) {S7 (); S2 ();}
if (a == 73) {S7 (); S3 ();}
if (a == 74) {S7 (); S4 ( );}
if (a == 75) {S7 (); S5 ();}
if (a == 76) {S7 (); S6 ();}
if (a == 77) {S7 (); S7 ();}
if (a == 78) {S7 (); S8 ();}
if (a == 79) {S7 (); S9 ();}
if (a == 80) {S8 (); S0 ();}
if (a == 81) {S8 (); S1 ();}
if (a == 82) {S8 (); S2 ();}
if (a == 83) {S8 (); S3 ();}
if (a == 84) {S8 (); S4 (); }
if (a == 85) {S8 (); S5 ();}
if (a == 86) {S8 (); S6 ();}
if (a == 87) {S8 (); S7 () ;}
if (a == 88) {S8 (); S8 ();}
if (a == 89) {S8 (); S9 ();}
if (a == 90) {S9 (); S0 ( );}
if (a == 91) {S9 (); S1 ();}
if (a == 92) {S9 (); S2 ();}
if (a == 93) {S9 (); S3 ();}
if (a == 94) {S9 (); S4 ();}
if (a == 95) {S9 (); S5 ();}
if (a == 96) {S9 (); S6 ();}
if (a == 97) {S9 (); S7 ();}
if (a == 98) {S9 (); S8 ();}
if (a == 99) {S9 () ; S9 ();}
if (a == 100) {Son ();}
}
}
Video demonstrating robots with Sony:
With samsung TVs, the situation is a little more complicated. the IRremote library does not recognize the signals of their consoles, so you just have to send them in the same form in which they come in RAW format.
Sketch for working with a Samsung TV
#include
IRsend irsend;
unsigned long a;
void setup () {
Serial.begin (9600);
Serial.setTimeout (4);
pinMode (ledPin, OUTPUT);
}
unsigned int A_one [78] = {4450.4550,400,1800,450,650,450,1800,450,600,500,650,450,650,450,700,450,650,450,150,450,650,500,650,450,650,450,650,450,650,450,650,450,650,450,650,450,650,450,650,450,650,450,650,450,650,450,650,450,650,450,450,650,450,650,450,650,450,650,450,650,450,650,450,650,450,650,450,650,450,650. , 1750,450,1800,450,1700,450};
unsigned int A_two [78] = {4450,4550,450,1750,450,650,550,150,750,500,600,450,650,450,650,500,650,450,650,500,500,650,450,650,450,650,650,450,650,450,650,450,650,450,650,450,650,450,650,450,650,450,650,450,650,650,450,650,450,650,450,650,450,650,450,650 1750,450,1750,500,1650,500};
unsigned int A_three[78]={4450,4500,450,1750,450,700,450,1750,450,650,450,650,500,650,450,650,450,650,500,1750,450,650,450,1750,500,600,500,650,450,650,450,650,500,650,450,650,450,1750,500,1750,450,650,450,650,500,650,450,650,450,650,450,1750,500,650,450,650,500,1700,450,1800,450,1700,500,1750,500,1650,500};
unsigned int A_four[78]={4450,4550,450,1750,450,700,450,1750,450,650,450,650,500,650,450,650,450,650,500,1700,500,650,450,1750,500,600,500,650,450,650,450,650,500,650,450,650,450,650,500,650,450,1700,500,600,500,650,450,650,500,600,500,1750,450,1750,500,1750,450,600,500,1750,500,1700,500,1750,500,1650,500};
unsigned int A_five [78] = {4450.4550,450,1750,450,650,500,650,450,650,450,650,550,650,450,450,650,650,450,650,450,650,450,650,650,450,650,450,650,650,450,650,650,450,650,450,650,450,650,450,650,450,650,450,650,450,650,450,650,450,650,650,450,650,450,650,650,450,650,650,450,650,650,450,650,650,650,650,450,650,650,650. 1750,450,1750,500,1650,500};
unsigned int A_six [78] = {4400,4550,450,1800,400,700,400,1800,450,650,450,700,400,700,450,650,450,650,500,1750,450,650,450,1750,500,600,500,650,450,650,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450 1750,450,1750,450,1700,500};
unsigned int A_seven[78]={4450,4550,450,1750,450,650,450,1800,450,650,450,650,450,650,500,650,450,650,450,1750,500,600,500,1750,500,600,500,600,500,650,450,650,500,600,500,650,450,650,500,1750,450,1700,500,600,500,650,450,650,450,650,500,1750,450,1750,500,600,500,650,450,1700,550,1700,500,1750,450,1700,500};
unsigned int A_eight[78]={4400,4550,450,1750,450,650,450,1800,450,650,450,650,450,700,400,650,500,650,450,1750,450,700,450,1750,500,600,450,700,450,650,450,650,450,700,450,1750,450,650,450,1800,450,1700,500,650,450,650,450,700,450,600,500,650,450,1750,500,650,450,650,450,1750,450,1800,400,1800,450,1700,450};
unsigned int A_nine [78] = {4450.4500,450,1750,500,650,450,1800,450,600,450,650,500,650,450,650,450,700,450,150,450,650,650,500,600,550,650,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450 1750,450,1750,500,1650,500};
unsigned int A_zero [78] = {4450,4500,500,1750,450,650,450,1800,450,650,450,650,450,650,550,650,450,650,450,150,450,650,550,650,450,650,450,650,450,650,450,650,450,650,450,650,450,450,650,450,650,450,650,450,650,450,650,450,650,450,650,450,650,450,650,450,650,450,650,450,650,450,650,450,650,450,650,450,650,450,650,450,550 1750,500,1750,450,1700,450};
unsigned int A_w[78]={4450,4550,450,1750,450,650,500,1750,450,650,450,650,450,650,500,650,450,650,500,1700,500,600,500,1750,500,600,500,650,450,650,450,650,500,650,450,650,450,650,500,600,500,600,500,1750,500,600,500,1700,500,650,450,1750,450,1800,450,1750,450,1750,450,650,450,1750,500,650,450,1700,500};
unsigned int A_on[78]={4450,4550,450,1750,450,650,450,1800,450,650,450,650,450,650,450,700,450,650,450,1750,450,700,450,1750,500,600,450,650,500,650,450,650,450,700,450,650,450,1750,450,650,450,700,450,650,450,650,500,650,450,650,450,1750,450,700,450,1750,450,1750,400,1800,450,1800,400,1800,450,1700,450};
void S1() {irsend.sendRaw(A_one,78,38);delay(500);}
void S2() {irsend.sendRaw(A_two,78,38);delay(500);}
void S3() {irsend.sendRaw(A_three,78,38);delay(500);}
void S4 () {irsend.sendRaw (A_four, 78.38); delay (500);}
void S5 () {irsend.sendRaw (A_five, 78.38); delay (500);}
void S6 () {irsend .sendRaw (A_six, 78.38); delay (500);}
void S7 () {irsend.sendRaw (A_seven, 78.38); delay (500);}
void S8 () {irsend.sendRaw (A_eight, 78 , 38); delay (500);}
void S9 () {irsend.sendRaw (A_nine, 78.38); delay (500);}
void S0 () {irsend.sendRaw (A_zero, 78.38); delay ( 500);}
void Son () {irsend.sendRaw (A_on, 78.38); delay (500);}
void loop ()
{
if (Serial.available ())
{a = Serial.parseInt ();
if (a == 101) {Son ();}
if (a == 102) {S2 ();}
if (a == 103) {S3 ();}
if (a == 1) {S1 () ;}
if (a == 2) {S2 ();}
if (a == 3) {S3 ();}
if (a == 4) {S4 ();}
if (a == 5) {S5 ();}
if (a == 6) {S6 ();}
if (a == 7) {S7 () ;}
if (a == 8) {S8 ();}
if (a == 9) {S9 ();}
if (a == 10) {S1 (); S0 ();}
if (a == 11) {S1 (); S1 ();}
if (a == 12) {S1 (); S2 ();}
if (a == 13) {S1 (); S3 ();}
if (a = = 14) {S1 (); S4 ();}
if (a == 15) {S1 (); S5 ();}
if (a == 16) {S1 (); S6 ();}
if (a == 17) {S1 (); S7 ();}
if (a == 18) {S1 (); S8 ();}
if (a == 19) {S1 (); S9 ();}
if ( a == 20) {S2 (); S0 ();}
if (a == 21) {S2 (); S1 ();}
if (a == 22) {S2 (); S2 ();}
if (a == 23) {S2 (); S3 ();}
if (a == 24) {S2 (); S4 ();}
if (a == 25) {S2 (); S5 ();}
if (a == 26) {S2 (); S6 ();}
if (a == 27) {S2 (); S7 ();}
if (a == 28) {S2 (); S8 ();}
if (a == 29) {S2 (); S9 ();}
if (a == 30) {S3 (); S0 (); }
if (a == 31) {S3 (); S1 ();}
if (a == 32) {S3 (); S2 ();}
if (a == 33) {S3 (); S3 () ;}
if (a == 34) {S3 (); S4 ();}
if (a == 35) {S3 (); S5 ();}
if (a == 36) {S3 (); S6 ( );}
if (a == 37) {S3 (); S7 ();}
if (a == 38) {S3 (); S8 ();}
if (a == 39) {S3 (); S9 ();}
if (a == 40) {S4 (); S0 ();}
if (a == 41) {S4 (); S1 ();}
if (a == 42) {S4 (); S2 ();}
if (a == 43) {S4 (); S3 ();}
if (a == 44) {S4 (); S4 ();}
if (a == 45) {S4 () ; S5 ();}
if (a == 46) {S4 (); S6 ();}
if (a == 47) {S4 (); S7 ();}
if (a == 48) {S4 ( ); S8 ();}
if (a == 49) {S4 (); S9 ();}
if (a == 50) {S5 (); S0 ();}
if (a == 51) {S5 (); S1 ();}
if (a == 52) {S5 (); S2 ();}
if (a == 53) {S5 (); S3 (); }
if (a == 54) {S5 (); S4 ();}
if (a == 55) {S5 (); S5 ();}
if (a == 56) {S5 (); S6 () ;}
if (a == 57) {S5 (); S7 ();}
if (a == 58) {S5 (); S8 ();}
if (a == 59) {S5 (); S9 ( );}
if (a == 60) {S6 (); S0 ();}
if (a == 61) {S6 (); S1 ();}
if (a == 62) {S6 (); S2 ();}
if (a == 63) {S6 (); S3 ();}
if (a == 64) {S6 (); S4 ();}
if (a == 65) {S6 (); S5 ();}
if (a == 66) {S6 (); S6 ();}
if (a == 67) {S6 (); S7 ();}
if (a == 68) {S6 () ; S8 ();}
if (a == 69) {S6 (); S9 ();}
if (a == 70) {S7 (); S0 ();}
if (a == 71) {S7 ( ); S1 ();}
if (a == 72) {S7 (); S2 ();}
if (a == 73) {S7 (); S3 ();}
if (a == 74) {S7 (); S4 ();}
if (a == 75) {S7 (); S5 ();}
if (a == 76) {S7 (); S6 (); }
if (a == 77) {S7 (); S7 ();}
if (a == 78) {S7 (); S8 ();}
if (a == 79) {S7 (); S9 () ;}
if (a == 80) {S8 (); S0 ();}
if (a == 81) {S8 (); S1 ();}
if (a == 82) {S8 (); S2 ( );}
if (a == 83) {S8 (); S3 ();}
if (a == 84) {S8 (); S4 ();}
if (a == 85) {S8 (); S5 ();}
if (a == 86) {S8 (); S6 ();}
if (a == 87) {S8 (); S7 ();}
if (a == 88) {S8 (); S8 ();}
if (a == 89) {S8 (); S9 ();}
if (a == 90) {S9 (); S0 ();}
if (a == 91) {S9 () ; S1 ();}
if (a == 92) {S9 (); S2 ();}
if (a == 93) {S9 (); S3 ();}
if (a == 94) {S9 ( ); S4 ();}
if (a == 95) {S9 (); S5 ();}
if (a == 96) {S9 (); S6 ();}
if (a == 97) {S9 (); S7 ();}
if (a == 98) {S9 (); S8 ();}
if (a == 99) {S9 (); S9 (); }
if (a == 100) {S1 (); S0 (); S0 (); }
}
}
IRsend irsend;
unsigned long a;
void setup () {
Serial.begin (9600);
Serial.setTimeout (4);
pinMode (ledPin, OUTPUT);
}
unsigned int A_one [78] = {4450.4550,400,1800,450,650,450,1800,450,600,500,650,450,650,450,700,450,650,450,150,450,650,500,650,450,650,450,650,450,650,450,650,450,650,450,650,450,650,450,650,450,650,450,650,450,650,450,650,450,650,450,450,650,450,650,450,650,450,650,450,650,450,650,450,650,450,650,450,650,450,650. , 1750,450,1800,450,1700,450};
unsigned int A_two [78] = {4450,4550,450,1750,450,650,550,150,750,500,600,450,650,450,650,500,650,450,650,500,500,650,450,650,450,650,650,450,650,450,650,450,650,450,650,450,650,450,650,450,650,450,650,450,650,650,450,650,450,650,450,650,450,650,450,650 1750,450,1750,500,1650,500};
unsigned int A_three[78]={4450,4500,450,1750,450,700,450,1750,450,650,450,650,500,650,450,650,450,650,500,1750,450,650,450,1750,500,600,500,650,450,650,450,650,500,650,450,650,450,1750,500,1750,450,650,450,650,500,650,450,650,450,650,450,1750,500,650,450,650,500,1700,450,1800,450,1700,500,1750,500,1650,500};
unsigned int A_four[78]={4450,4550,450,1750,450,700,450,1750,450,650,450,650,500,650,450,650,450,650,500,1700,500,650,450,1750,500,600,500,650,450,650,450,650,500,650,450,650,450,650,500,650,450,1700,500,600,500,650,450,650,500,600,500,1750,450,1750,500,1750,450,600,500,1750,500,1700,500,1750,500,1650,500};
unsigned int A_five [78] = {4450.4550,450,1750,450,650,500,650,450,650,450,650,550,650,450,450,650,650,450,650,450,650,450,650,650,450,650,450,650,650,450,650,650,450,650,450,650,450,650,450,650,450,650,450,650,450,650,450,650,450,650,650,450,650,450,650,650,450,650,650,450,650,650,450,650,650,650,650,450,650,650,650. 1750,450,1750,500,1650,500};
unsigned int A_six [78] = {4400,4550,450,1800,400,700,400,1800,450,650,450,700,400,700,450,650,450,650,500,1750,450,650,450,1750,500,600,500,650,450,650,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450 1750,450,1750,450,1700,500};
unsigned int A_seven[78]={4450,4550,450,1750,450,650,450,1800,450,650,450,650,450,650,500,650,450,650,450,1750,500,600,500,1750,500,600,500,600,500,650,450,650,500,600,500,650,450,650,500,1750,450,1700,500,600,500,650,450,650,450,650,500,1750,450,1750,500,600,500,650,450,1700,550,1700,500,1750,450,1700,500};
unsigned int A_eight[78]={4400,4550,450,1750,450,650,450,1800,450,650,450,650,450,700,400,650,500,650,450,1750,450,700,450,1750,500,600,450,700,450,650,450,650,450,700,450,1750,450,650,450,1800,450,1700,500,650,450,650,450,700,450,600,500,650,450,1750,500,650,450,650,450,1750,450,1800,400,1800,450,1700,450};
unsigned int A_nine [78] = {4450.4500,450,1750,500,650,450,1800,450,600,450,650,500,650,450,650,450,700,450,150,450,650,650,500,600,550,650,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450 1750,450,1750,500,1650,500};
unsigned int A_zero [78] = {4450,4500,500,1750,450,650,450,1800,450,650,450,650,450,650,550,650,450,650,450,150,450,650,550,650,450,650,450,650,450,650,450,650,450,650,450,650,450,450,650,450,650,450,650,450,650,450,650,450,650,450,650,450,650,450,650,450,650,450,650,450,650,450,650,450,650,450,650,450,650,450,650,450,550 1750,500,1750,450,1700,450};
unsigned int A_w[78]={4450,4550,450,1750,450,650,500,1750,450,650,450,650,450,650,500,650,450,650,500,1700,500,600,500,1750,500,600,500,650,450,650,450,650,500,650,450,650,450,650,500,600,500,600,500,1750,500,600,500,1700,500,650,450,1750,450,1800,450,1750,450,1750,450,650,450,1750,500,650,450,1700,500};
unsigned int A_on[78]={4450,4550,450,1750,450,650,450,1800,450,650,450,650,450,650,450,700,450,650,450,1750,450,700,450,1750,500,600,450,650,500,650,450,650,450,700,450,650,450,1750,450,650,450,700,450,650,450,650,500,650,450,650,450,1750,450,700,450,1750,450,1750,400,1800,450,1800,400,1800,450,1700,450};
void S1() {irsend.sendRaw(A_one,78,38);delay(500);}
void S2() {irsend.sendRaw(A_two,78,38);delay(500);}
void S3() {irsend.sendRaw(A_three,78,38);delay(500);}
void S4 () {irsend.sendRaw (A_four, 78.38); delay (500);}
void S5 () {irsend.sendRaw (A_five, 78.38); delay (500);}
void S6 () {irsend .sendRaw (A_six, 78.38); delay (500);}
void S7 () {irsend.sendRaw (A_seven, 78.38); delay (500);}
void S8 () {irsend.sendRaw (A_eight, 78 , 38); delay (500);}
void S9 () {irsend.sendRaw (A_nine, 78.38); delay (500);}
void S0 () {irsend.sendRaw (A_zero, 78.38); delay ( 500);}
void Son () {irsend.sendRaw (A_on, 78.38); delay (500);}
void loop ()
{
if (Serial.available ())
{a = Serial.parseInt ();
if (a == 101) {Son ();}
if (a == 102) {S2 ();}
if (a == 103) {S3 ();}
if (a == 1) {S1 () ;}
if (a == 2) {S2 ();}
if (a == 3) {S3 ();}
if (a == 4) {S4 ();}
if (a == 5) {S5 ();}
if (a == 6) {S6 ();}
if (a == 7) {S7 () ;}
if (a == 8) {S8 ();}
if (a == 9) {S9 ();}
if (a == 10) {S1 (); S0 ();}
if (a == 11) {S1 (); S1 ();}
if (a == 12) {S1 (); S2 ();}
if (a == 13) {S1 (); S3 ();}
if (a = = 14) {S1 (); S4 ();}
if (a == 15) {S1 (); S5 ();}
if (a == 16) {S1 (); S6 ();}
if (a == 17) {S1 (); S7 ();}
if (a == 18) {S1 (); S8 ();}
if (a == 19) {S1 (); S9 ();}
if ( a == 20) {S2 (); S0 ();}
if (a == 21) {S2 (); S1 ();}
if (a == 22) {S2 (); S2 ();}
if (a == 23) {S2 (); S3 ();}
if (a == 24) {S2 (); S4 ();}
if (a == 25) {S2 (); S5 ();}
if (a == 26) {S2 (); S6 ();}
if (a == 27) {S2 (); S7 ();}
if (a == 28) {S2 (); S8 ();}
if (a == 29) {S2 (); S9 ();}
if (a == 30) {S3 (); S0 (); }
if (a == 31) {S3 (); S1 ();}
if (a == 32) {S3 (); S2 ();}
if (a == 33) {S3 (); S3 () ;}
if (a == 34) {S3 (); S4 ();}
if (a == 35) {S3 (); S5 ();}
if (a == 36) {S3 (); S6 ( );}
if (a == 37) {S3 (); S7 ();}
if (a == 38) {S3 (); S8 ();}
if (a == 39) {S3 (); S9 ();}
if (a == 40) {S4 (); S0 ();}
if (a == 41) {S4 (); S1 ();}
if (a == 42) {S4 (); S2 ();}
if (a == 43) {S4 (); S3 ();}
if (a == 44) {S4 (); S4 ();}
if (a == 45) {S4 () ; S5 ();}
if (a == 46) {S4 (); S6 ();}
if (a == 47) {S4 (); S7 ();}
if (a == 48) {S4 ( ); S8 ();}
if (a == 49) {S4 (); S9 ();}
if (a == 50) {S5 (); S0 ();}
if (a == 51) {S5 (); S1 ();}
if (a == 52) {S5 (); S2 ();}
if (a == 53) {S5 (); S3 (); }
if (a == 54) {S5 (); S4 ();}
if (a == 55) {S5 (); S5 ();}
if (a == 56) {S5 (); S6 () ;}
if (a == 57) {S5 (); S7 ();}
if (a == 58) {S5 (); S8 ();}
if (a == 59) {S5 (); S9 ( );}
if (a == 60) {S6 (); S0 ();}
if (a == 61) {S6 (); S1 ();}
if (a == 62) {S6 (); S2 ();}
if (a == 63) {S6 (); S3 ();}
if (a == 64) {S6 (); S4 ();}
if (a == 65) {S6 (); S5 ();}
if (a == 66) {S6 (); S6 ();}
if (a == 67) {S6 (); S7 ();}
if (a == 68) {S6 () ; S8 ();}
if (a == 69) {S6 (); S9 ();}
if (a == 70) {S7 (); S0 ();}
if (a == 71) {S7 ( ); S1 ();}
if (a == 72) {S7 (); S2 ();}
if (a == 73) {S7 (); S3 ();}
if (a == 74) {S7 (); S4 ();}
if (a == 75) {S7 (); S5 ();}
if (a == 76) {S7 (); S6 (); }
if (a == 77) {S7 (); S7 ();}
if (a == 78) {S7 (); S8 ();}
if (a == 79) {S7 (); S9 () ;}
if (a == 80) {S8 (); S0 ();}
if (a == 81) {S8 (); S1 ();}
if (a == 82) {S8 (); S2 ( );}
if (a == 83) {S8 (); S3 ();}
if (a == 84) {S8 (); S4 ();}
if (a == 85) {S8 (); S5 ();}
if (a == 86) {S8 (); S6 ();}
if (a == 87) {S8 (); S7 ();}
if (a == 88) {S8 (); S8 ();}
if (a == 89) {S8 (); S9 ();}
if (a == 90) {S9 (); S0 ();}
if (a == 91) {S9 () ; S1 ();}
if (a == 92) {S9 (); S2 ();}
if (a == 93) {S9 (); S3 ();}
if (a == 94) {S9 ( ); S4 ();}
if (a == 95) {S9 (); S5 ();}
if (a == 96) {S9 (); S6 ();}
if (a == 97) {S9 (); S7 ();}
if (a == 98) {S9 (); S8 ();}
if (a == 99) {S9 (); S9 (); }
if (a == 100) {S1 (); S0 (); S0 (); }
}
}
Demonstration of work here:
We figured out the arduino, now go to Android. The application is easiest to make using the visual development environment of Android applications App Inventor 2, although here it is more convenient for someone. The application should have simple functionality: connect to the paired bluetooth module and send the channel number to which you want to switch to it. The design of my application turned out to be very simple.
If someone wants to make the same application, I shot a video in which I explain in detail how and what to do for this. Even someone who has never programmed for android can figure it out. (to view you need to go to YouTube)
Now a few words about the advantages and disadvantages of my bluetooth remote control. The usefulness of this device for society raises serious doubts, however, like the usefulness of other smart / smart / bluetooth devices, such as, for example, a “smart” roulette , a Bluetooth sticker and a “smart” fridge magnet . But personally, the bluetooth remote control makes my life a little easier. If before I did not watch TV at all, now I turn it on sometimes, and only from a smartphone or tablet, depending on what is at hand.
In general, with such a scheme, you can control not only the TV, but all the devices that are controlled, but this is a slightly different story.
PS A collection of over 100 instructional materials on arduino for beginners and pros here
PPS Online Arduino Gicktime course here.
And I want to finish the survey that I promised at the beginning of the article.
Only registered users can participate in the survey. Please come in.
What do you think is the best name for this device?
- 58.3% bluetooth remote 63
- 20.3% smart remote 22
- 7.4% smart remote 8
- 7.4% smart 8
- 6.4% own version in comments 7