Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void recebeir(){
- char valorlido = Serial.read();
- //liga-desliga
- const unsigned int S_pwr[68]={4600,4350,700,1550,650,1550,650,1600,650,450,650,450,650,450,650,450,700,400,700,1550,650,1550,650,1600,650,450,650,450,650,450,700,450,650,450,650,450,650,1550,700,450,650,450,650,450,650,450,650,450,700,400,650,1600,650,450,650,1550,650,1600,650,1550,650,1550,700,1550,650,1550,650};
- // channel up
- const unsigned int S_pup[68]={4600,4350,700,1500,700,1500,700,1550,700,450,650,400,700,450,650,450,700,400,700,1500,700,1550,650,1550,700,450,650,450,700,400,700,400,700,400,700,400,700,1550,700,400,700,400,700,1550,650,450,700,400,700,400,700,1550,650,450,650,1600,650,1550,650,450,700,1500,700,1500,700,1550,650};
- // channel down
- const unsigned int S_pdown[68]={4650,4300,700,1550,700,1500,700,1550,700,400,700,400,700,400,700,450,650,450,650,1550,700,1500,700,1550,700,400,700,400,700,400,700,450,700,400,700,400,700,400,700,450,650,450,650,1550,700,400,700,450,650,400,700,1550,700,1500,700,1550,700,1500,700,400,700,1550,650,1550,700,1500,700};
- // volume up
- const unsigned int S_vup[68]={4600,4350,650,1550,700,1500,700,1550,700,400,700,400,700,450,650,450,700,400,700,1500,700,1550,650,1550,700,400,700,400,700,450,650,450,700,400,700,1500,700,1550,650,1550,700,400,700,450,700,400,700,400,700,400,700,450,650,450,650,450,650,1550,700,1500,700,1550,700,1500,700,1550,650};
- // volume down
- const unsigned int S_vdown[68]={4600,4350,700,1550,650,1550,700,1500,700,450,650,450,700,400,700,400,700,400,700,1550,700,1500,700,1550,700,400,700,400,700,400,700,450,650,450,650,1550,700,1500,700,450,650,1550,700,400,700,400,700,450,700,400,700,400,700,400,700,1550,700,400,700,1500,700,1500,700,1550,700,1500,700};
- // mute
- const unsigned int S_mute[68]={4650,4350,650,1550,650,1550,700,1550,700,400,700,400,700,400,700,450,650,450,650,1550,700,1500,700,1550,700,400,700,450,650,400,700,450,700,400,700,1500,700,1550,650,1550,700,1500,700,450,700,400,700,400,700,400,700,400,700,450,650,450,700,400,700,1500,700,1550,650,1550,700,1500,700};
- // source
- const unsigned int S_scr[68]={4600,4350,700,1550,650,1550,700,1500,700,450,650,450,700,400,700,400,700,400,700,1550,700,1500,700,1550,700,400,700,400,700,400,700,400,700,400,700,1550,700,400,700,450,650,450,650,450,700,400,700,400,700,400,700,450,650,1550,700,1500,700,1550,650,1550,700,1500,700,1550,700,1500,700};
- if (valorlido == 'O'){ //liga ou desliga a tv
- {
- for (int i = 0; i < 1; i++) //Envia um flash de led com 3 comandos
- irsend.sendRaw(S_pwr,68,38); //código clonado
- delay(52);
- }
- Serial.println("Liguei ou Desliguei a TV");
- }
- else if (valorlido == 'W'){ //Muda o canal para o canal acima
- {
- for (int i = 0; i < 1; i++) //Envia um flash de led com 3 comandos
- irsend.sendRaw(S_pup,68,38); //código clonado
- delay(52);
- }
- Serial.println("Canal +");
- }
- else if (valorlido == 'K'){ //Muda o canal para o canal abaixo
- {
- for (int i = 0; i < 1; i++) //Envia um flash de led com 3 comandos
- irsend.sendRaw(S_pup,68,38); //código clonado
- delay(52);
- }
- Serial.println("Canal -");
- }
- else if (valorlido == 'Y'){ //Aumenta o Volume da TV
- {
- for (int i = 0; i < 1; i++) //Envia um flash de led com 3 comandos
- irsend.sendRaw(S_vup,68,38); //código clonado
- delay(52);
- }
- Serial.println("Volume +");
- }
- else if (valorlido == 'Q'){ //Abaixa o Volume da TV
- {
- for (int i = 0; i < 1; i++) //Envia um flash de led com 3 comandos
- irsend.sendRaw(S_vdown,68,38); //código clonado
- delay(52);
- }
- Serial.println("Volume -");
- }
- else if (valorlido == 'M'){ //Deixa o Volume no Mudo
- {
- for (int i = 0; i < 1; i++) //Envia um flash de led com 3 comandos
- irsend.sendRaw(S_mute,68,38); //código clonado
- delay(52);
- }
- Serial.println("Mudo");
- }
- else if (valorlido == 'Z'){ //Acessa o source
- {
- for (int i = 0; i < 1; i++) //Envia um flash de led com 3 comandos
- irsend.sendRaw(S_scr,68,38); //código clonado
- delay(52);
- }
- Serial.println("Source");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement