Telecomandi Ir

Salve a tutti, sto sperimentando con dei ricevitori ad infrarossi e sto cercando di fare un telecomando universale su misura per controllare tutti gli apparecchi con un solo telecomando; ho utilizzato la libreria IRremote di Ken Shirriff con successo per quasi tutti gli apparecchi ma non riesco a decodificare soltanto il telecomando della mia vecchia cara xbox1 che uso come media center. Ho scoperto dopo molte ricerche che usa il protocollo RCA che non è previsto nella libreria e ho provato ad aggiungerlo prendendo come esempio gli altri protocolli ma non sono riuscito nell’impresa perchè ancora non sono in grado di analizzare script complessi data la mia inesperienza. Ho provato quindi a cercare in rete ma senza risultato e alla fine dopo molti tentativi sono riuscito a far funzionare la xbox usando lo sketch di esempio IRrecord che è anche trattato nel playground italiano: http://www.arduino.cc/playground/Italiano/ComandareArduinoConUnTelecomandoqualsiasi
Lo sketch in pratica funziona in questo modo, si preme un pulsante sul telecomando nelle vicinanze di un sensore ad infrarossi collegato ad arduino il quale provvede a decodificarne il segnale e a salvarlo in memoria. Successivamente tramite un pulsante ed un led infrarosso collegati su arduino si provvede a riprodurre il segnale prima memorizzato. Per tutte le altre periferiche, quali tv, videoregistratore, stereo la libreria riconosce i telecomandi quindi è sufficiente soltanto annotare il codice relativo ad ogni tasto e ad inviarlo tramite il comando appropriato in base al protocollo, riporto ad esempio i comandi per il mio monitor, un LG flatron M1921A che usa il protocollo NEC, chissà magari serve a qualcuno:

#include <IRremote.h>
IRsend irsend;

void setup()
{
// Serial.begin(9600);
}

void loop()
{
for (int i = 0; i < 3; i++)
{
irsend.sendNEC(0x20DF906F,32); // monitor mute code
delay(100);
}
delay(2000); // pausa di 2 secondi solo per testare il funzionamento

// irsend.sendNEC(0x20DF906F, 32); // monitor mute code
// irsend.sendNEC(0x20DF10EF, 32); // monitor power code
// irsend.sendNEC(0x20DFF00F, 32); // monitor TV code
// irsend.sendNEC(0x20DFD02F, 32); // monitor input code
// irsend.sendNEC(0x20DF50AF, 32); // monitor I/II code
// irsend.sendNEC(0x20DFCA35, 32); // monitor list code
// irsend.sendNEC(0x20DF58A7, 32); // monitor q.view code
// irsend.sendNEC(0x20DFC23D, 32); // monitor menu code
// irsend.sendNEC(0x20DF00FF, 32); // monitor pr+ code
// irsend.sendNEC(0x20DF807F, 32); // monitor pr- code
// irsend.sendNEC(0x20DFC03F, 32); // monitor vol- code
// irsend.sendNEC(0x20DF40BF, 32); // monitor vol+ code
// irsend.sendNEC(0x20DF22DD, 32); // monitor ok code
// irsend.sendNEC(0x20DF708F, 32); // monitor sleep code
// irsend.sendNEC(0x20DF9E61, 32); // monitor * code
// irsend.sendNEC(0x20DF04FB, 32); // monitor text code
// irsend.sendNEC(0x20DF46B9, 32); // monitor update code
// irsend.sendNEC(0x20DF649B, 32); // monitor time code
// irsend.sendNEC(0x20DF26D9, 32); // monitor size code
// irsend.sendNEC(0x20DF24DB, 32); // monitor mix code
// irsend.sendNEC(0x20DFA659, 32); // monitor hold code
// irsend.sendNEC(0x20DF54AB, 32); // monitor reveal code
// irsend.sendNEC(0x20DF0EF1, 32); // monitor index code
// irsend.sendNEC(0x20DF44BB, 32); // monitor mode code
// irsend.sendNEC(0x20DF8679, 32); // monitor blu code
// irsend.sendNEC(0x20DFC639, 32); // monitor giallo code
// irsend.sendNEC(0x20DF8E71, 32); // monitor verde code
// irsend.sendNEC(0x20DF4EB1, 32); // monitor rosso code
// irsend.sendNEC(0x20DF4AB5, 32); // monitor ssm code
// irsend.sendNEC(0x20DFB24D, 32); // monitor psm code
// irsend.sendNEC(0x20DF08F7, 32); // monitor 0 code
// irsend.sendNEC(0x20DF8877, 32); // monitor 1 code
// irsend.sendNEC(0x20DF48B7, 32); // monitor 2 code
// irsend.sendNEC(0x20DFC837, 32); // monitor 3 code
// irsend.sendNEC(0x20DF28D7, 32); // monitor 4 code
// irsend.sendNEC(0x20DFA857, 32); // monitor 5 code
// irsend.sendNEC(0x20DF6897, 32); // monitor 6 code
// irsend.sendNEC(0x20DFE817, 32); // monitor 7 code
// irsend.sendNEC(0x20DF18E7, 32); // monitor 8 code
// irsend.sendNEC(0x20DF9867, 32); // monitor 9 code

Per quanto riguarda il telecomando della xbox ricevo soltanto il rawCode in quanto il protocollo che usa non è supportato, ad esempio il tasto pause mi restituisce questo nel serial monitor:
m600, s500, m500, s1550, m450, s1600, m450, s1600, m450, s1550, m500, s1600, m450, s1600, m450, s1600, m450, s1600, m450, s1550, m500, s1550, m500, s1550, m500, s1550, m1400, s550, m500
Ho provato ad inviarli usando la funzione sendRaw prevista nella libreria ma non va. L’unica via che mi è rimasta è quella di adattare lo sketch IRrecord che funziona bene: pensavo di annotarmi tutti i rawcodes che mi restituisce lo sketch eliminando di fatto la parte dedicata alla ricezione ed il pulsante. Questa è la teoria, in pratica ancora non riesco a farlo perchè non capisco cosa fa esattmente il codice in alcuni passaggi in quanto non ho mai visto usare certi script, come ad esempio “codeType = results → decode_type;”
Ho provato a chiedere aiuto nel blog dell’autore della libreria ma non sembra gradire la mia richiesta in quanto ha rimosso il mio commento, ora provo a chiedere un aiuto qui, magari qualcuno è più magnanimo. C’è qualcuno che è riuscito ad inviare codici usando la funzione sendRaw oppure qualcuno che ha tempo di spiegarmi come è meglio procedere?
Spero di non avervi annoiato troppo e innanzitutto chiedo scusa per il post così lungo.

guarda la configurazione di lirc in questo esempio, magari integrando un pò di informazioni riesci a mettere sù una libreria apposita su RCA ;) http://www.mythtv.org/wiki/XBOX_DVD_IR_Receiver

Salve a tutti, sono riuscito finalmente a far funzionare il codice, riesco ad inviare i segnali con la funzione sendRaw prevista nella libreria, considerate pure il post chiuso. Adesso mi rimane di decodificare tutti i tasti del telecomando e se vi può interessare fatemelo sapere che lo posto volentieri. Saluti.

posta posta, è sapere in più che non fa mai male :D E comunque anche io mi appresterò a creare un telecomando universale..

// telecomando xbox int xPause[152] = {550,550,1400,600,400,1650,1350,600,400,1650,400,1650,400,1650,1350,600,400,1650,400,1650,1350,600,1350,600,400,1650,400,1650,400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29,0,0,-30256,0,-29401,0,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1536,22273,-15101}; int xDisplay[152] = {550,500,1400,600,450,1600,1400,550,450,1600,450,1600,450,1550,500,1550,1400,600,450,1600,450,1550,500,1550,1400,600,1350,600,450,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29,0,0,27821,0,28496,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1536,22273,-15101}; int xReverse[152] = {550,500,1400,600,450,1600,1350,600,450,1600,450,1600,450,1600,1350,600,450,1600,450,1600,450,1550,500,1550,1400,600,1350,600,450,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29,0,0,8799,0,9017,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1536,22273,-15101}; int xPlay[152] = {600,450,500,1550,500,1550,500,1550,500,1550,450,1600,450,1550,500,1600,450,1600,450,1600,450,1600,450,1600,450,1600,1400,550,450,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29,0,0,-21158,0,-20084,0,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1536,22273,-15101}; int xForward[152] = {550,550,1400,550,500,1550,1400,550,500,1550,500,1550,500,1550,1400,550,500,1550,500,1550,500,1550,1400,550,1400,550,500,1550,500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29,0,0,7345,1,9101,1,60,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1536,22273,-15101}; int xSkipLow[152] = {550,500,1450,550,500,1550,1400,550,500,1550,500,1550,500,1550,1400,550,500,1550,500,1550,1400,550,500,1550,500,1550,1400,550,500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29,0,0,7118,0,7296,0,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1536,22273,-15101}; int xStop[152] = {600,450,1450,550,450,1600,1400,550,450,1600,450,1600,450,1600,1400,550,450,1600,450,1600,1400,550,450,1600,1400,550,450,1600,450,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29,0,0,32410,0,-32340,0,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1536,22273,-15101}; int xSkipHigh[152] = {550,500,1400,600,450,1600,1350,600,450,1550,500,1550,500,1550,1400,600,450,1550,500,1550,1400,600,1350,600,1400,550,1400,550,450,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29,0,0,-5693,0,-4249,0,77,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1536,22273,-15101}; int xTitle[152] = {600,450,1400,600,450,1600,1350,600,450,1550,500,1550,1400,600,450,1600,450,1600,450,1600,450,1600,450,1600,1350,550,1400,600,450,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29,0,0,-31538,0,-30713,0,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1536,22273,-15101}; int xInfo[152] = {550,500,1400,600,450,1600,1350,600,450,1600,450,1600,1350,600,450,1600,450,1600,450,1550,500,1600,1350,600,450,1600,1350,600,450,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29,0,0,-1648,0,-107,0,84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1536,22273,-15101}; int xUp[152] = {600,450,1450,550,450,1600,1400,550,500,1550,450,1600,450,1600,450,1600,1400,550,450,1600,450,1600,1400,550,450,1600,1400,550,450,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29,0,0,26518,1,28735,1,85,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1536,22273,-15101}; int xDown[152] = {600,500,1400,550,500,1550,1400,550,500,1550,500,1550,500,1550,450,1600,1400,550,500,1550,1400,550,1400,600,450,1600,450,1550,450,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29,0,0,5451,0,5588,0,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1536,22273,-15101}; int xLeft[152] = {550,500,1400,600,450,1600,1350,600,450,1600,450,1600,450,1550,500,1550,1400,550,500,1550,500,1550,1400,600,1350,600,450,1600,450,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29,0,0,-27981,0,-27071,0,94,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1536,22273,-15101}; int xRight[152] = {550,500,1450,550,450,1600,1400,550,450,1600,450,1600,450,1600,450,1600,1400,550,450,1600,1400,550,450,1600,1400,550,450,1600,450,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29,0,0,-5907,0,-4468,0,60,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1536,22273,-15101}; int xMenu[152] = {600,450,1500,500,500,1550,1450,500,500,1550,500,1550,1450,500,500,1550,500,1550,500,1550,500,1550,1450,500,1450,500,500,1550,500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29,0,0,6798,0,6968,0,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1536,22273,-15101}; int xSelect[152] = {550,500,1450,500,500,1550,1450,550,450,1600,450,1550,500,1550,500,1550,1450,500,500,1550,1450,550,450,1550,500,1550,1450,500,500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29,0,0,30774,0,31520,0,120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1536,22273,-15101}; int xBack[152] = {600,450,1450,550,450,1600,1400,550,450,1600,450,1600,1400,550,450,1600,450,1600,450,1600,1400,550,450,1600,450,1600,1400,550,450,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29,0,0,-8843,0,-7475,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1536,22273,-15101};

Segue nel prossimo post

int xZero[152] = {600,450,500,1550,500,1600,450,1600,400,1600,450,1650,400,1600,450,1600,450,1600,450,1600,450,1600,450,1600,450,1600,1350,600,450,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29,0,0,12632,0,12943,0,69,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1536,22273,-15101};
int xUno[152] = {550,500,1450,550,450,1600,1400,550,450,1600,1400,600,400,1600,450,1600,450,1600,450,1600,450,1600,450,1600,1350,600,1400,550,450,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29,0,0,29655,0,30374,0,13,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1536,22273,-15101};
int xDue[152] = {550,500,1450,500,500,1550,1450,500,500,1550,1450,550,450,1600,450,1550,500,1550,500,1550,500,1550,1450,500,500,1550,1450,500,500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29,0,0,-14202,0,-12961,0,56,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1536,22273,-15101};
int xTre[152] = {550,500,1400,550,500,1550,1400,550,500,1550,1400,600,450,1550,500,1550,500,1550,500,1550,500,1550,1400,550,1400,550,500,1550,500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29,0,0,4706,0,4826,0,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1536,22273,-15101};
int xQuattro[152] = {550,500,1400,600,450,1600,1350,600,450,1600,1350,600,450,1600,450,1600,450,1600,450,1550,1400,600,450,1550,500,1550,1400,550,500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29,0,0,25011,0,25619,0,81,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1536,22273,-15101};
int xCinque[152] = {600,500,1400,600,450,1550,1400,600,450,1600,1350,600,450,1600,450,1550,500,1600,450,1550,1400,600,450,1600,1350,600,450,1600,450,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29,0,0,-24385,0,-23389,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1536,22273,-15101};
int xSei[152] = {600,500,500,1550,450,1600,450,1600,450,1600,450,1600,450,1600,450,1600,450,1550,500,1550,500,1550,500,1550,500,1550,1400,550,450,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29,0,0,4067,0,4171,0,121,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1536,22273,-15101};
int xSette[152] = {550,500,1400,600,450,1600,1350,600,450,1600,1400,550,450,1600,450,1600,450,1600,450,1550,1400,600,1350,600,1400,550,1400,550,450,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29,0,0,23669,0,24245,0,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1536,22273,-15101};
int xOtto[152] = {550,500,500,1550,500,1550,450,1550,500,1550,500,1550,500,1550,500,1550,500,1550,500,1550,500,1550,500,1550,500,1550,1400,550,500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29,0,0,-18876,0,-17747,0,37,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1536,22273,-15101};
int xNove[152] = {600,500,500,1550,450,1600,450,1600,450,1600,450,1600,450,1600,450,1600,450,1550,500,1550,500,1550,500,1550,500,1550,1400,550,500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29,0,0,6194,0,6349,0,124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1536,22273,-15101};

// Codice di esempio per premere il tasto Pause:

for (int i = 0; i < 3; i++)
{
irsend.sendRaw(xPause,29,38); // 29 e 38 sono costanti
delay(100);
}

mhn potresti creare una pagina nel playground con queste informazioni...cosi potrebbero andare perse.. Grazie per le info!

Ottimo consiglio, quando avrò finito di decodificare i telecomandi lo farò senz'altro, almeno mostro il progetto completo. Ciao.

Sempre grande il nostro Pelletta

gslow, così mi fai arrossire ;) Invece mi sento come fossi " l'ultima carrozza del treno" come si dice dalle mie parti. Aggiungo una cosa molto importante che non ho specificato: il telecomando della xbox che ho non è quello originale Microsoft, quindi i codici potrebbero non funzionare per chi ha l'originale!

ciao! Hai per caso postato tutto il progetto completo? Mi interessa !:D

Ciao Nyo, cosa intendi per completo? Qui ci sono gli sketch con i tasti decodificati per il telecomando della xbox e del monitor LG flatron M1921A, c'è anche l'esempio di come fare per trasmetterli. Se non ti è chiaro qualcosa fammi sapere di cosa hai bisogno. Saluti

Ah, no credevo avresti fatto un riassunto di progetto e l'avresti messo nel playground :), ma non c'è problema :D

Però ti chiedo una cosa: ho provato con un telecomando di una CBOX3 (un lettore di schede di memoria di una moterboard, forse asus) dispositivo che mi permetteva di controllare il PC con un telecomando..bè a differenza tua con lo sketch di IRemote ricevo sia un codice RAW e sia un codice in formato HEX. Vuol dire che lo sketch ha riconosciuto qualche protocollo? Potrei utilizzare quel codice HEX direttamente e cioè inviandolo da arduino per fare delle cose?

Che sketch hai usato per decodificare i tasti? Ricordo che anche a me il telecomando della xbox restitituiva sia l'hex che il raw code ma quando provavo a trasmettere l'hex non mi funzionava. Comunque la libreria riconosce pochi protocolli e quando ciò avviene non fa vedere il raw code, inoltre se qualche protocollo viene riconosciuto te lo dovrebbe dire, ad esempio nell'output seriale ti dirà "I received: nomeProtocollo" (vado a memoria).

Potrei utilizzare quel codice HEX direttamente e cioè inviandolo da arduino per fare delle cose?

Beh una prova non fa male, magari ti funziona.... ricordo di averci messo molto per decodificare quel telecomando.

Non ho inserito niente nel playground perchè in fondo non ho apportato migliorie al tutorial che già c'è a questo indirizzo: http://www.arduino.cc/playground/Italiano/ComandareArduinoConUnTelecomandoqualsiasi Ho soltanto decodificato due telecomandi.

e la decodifica l'hai fatta "manualmente"? Cioè hai preso i raw code e te li sei spulciati per bene in cerca di un pattern? Come sei riuscito ad isolare i codici di invio effettivo da quello di pulsante tenuto premuto?

Come sei riuscito ad isolare i codici di invio effettivo da quello di pulsante tenuto premuto?

Sul telecomando della xbox i tasti si premono una volta sola, non ci sono ad esempio i tasti del volume che richiedono una pressione continua. Per il resto mi sono fatto restituire tutti i valori del raw code e li ho messi in un array, così ho visto che effettivamente la trasmissione funziona. Saluti.

la cosa strana è che con il mio telecomando, ogni tanto ottengo dei codici diversi per lo stesso pulsante premuto.

Non so che dirti rispetto il tuo telecomando, prova a vedere che protocollo usa e come funziona la codifica, ad esempio il mio usava l'RCA e sinceramente non ci ho fatto caso se il codice cambiava o meno.

Ciao , mi potete aiutare nel creare un telecomando? Ho bisogno di poter comandare gli split del condizionatore tramite arduio. Ho preso il sensore IR di ricezione , collegato con arduino e scaricato il programma del COMANDO UNIVERSALE . Ogni volta che premo un tasto mi dice che il codice e' sconosciuto e lo salva come RAW. e mi stampa una marea di codici m1350 s440 ecc..ecc... Ma come faccio a salvarli ? li devo copiare in un array senza m e s ? e poi come li invio ? devo prendere un LED IR e ollegarlo direttamente alla porta DIGITAL OUT (il pin e' indifferente) che comando uso per inviare questo array ?

Grazie Ciao.

usa un’array di stringhe.
in C non esistono le stringhe, ma una stringa non è altro che un’array di caratteri.
quindi ottieni un’array di array di char

char comandi[lunghezza comando][lunghezza dato+1]

“dato” è “m1350” ecc… devi aggiungere un +1 perchè in realtà dato è “m1350\0” quel \0 è in realtà un solo carattere che indica la fine della stringa, se manca le print ed altre funzioni con le stringhe vanno in loop infinito, o meglio vanno a leggere aree di memoria al difuori della stringa finche non trovano uno ‘\0’
“comando” è l’insieme di dati che ricevi. Dato che non sai quali sono usa un numero grande, poi in realtà se impari le malloc puoi farle su misura.
quando leggi fai

comandi[comando attuale] = datoletto;

ps. son lo stesso lesto di robot-italy ;D