Presentazione e richiesta aiuto per sviluppo interfaccia telecomando

Salve a tutti mi chiamo Roberto, premetto che non sono un programmatore, mi stavo cimentando con l'arduino perchè mi servirebbe realizzare una semplice interfaccia che riesca a pilotare una Telecamera Panasonic Tm 700.

dovrei in un primo momento catturare il segnale del telecomando ir fornito in dotazione , e riprodurlo (come un ripetitore di segnale )
ho utilizzato un sensore TK1836 (36KHz non so se è la portante gusta della telecamera) e relativo emettitore i quali vedendoli con la telecamera alla pressione del tasto del telecomando corrisponde il lampeggio dell' emettitore ma con telecomando originale non a vista il led ir lampeggia ma la telecamera non fa nulla.

ho usato questo semplice codice,

void setup() {
Serial.begin(9600);
pinMode(11, INPUT);
pinMode(4,OUTPUT);
}

void loop() {
int sensorValue = digitalRead(11);
digitalWrite(4,sensorValue);
Serial.println(sensorValue, DEC);
}

qualcuno saprebbe darmi 2 dritte?

I telecomandi usano un protocollo per trasmettere un numero che corrisponde a un tasto. Ci sono piú possibilitá di diverse ditte.
Consulta il sito:

Ciao Uwe

Grazie,
non avendo la decodifica della panasonic dal serial monitor mi restituisce zero
hanno postato sotto del codice di decodifica non ho idea come inserirlo,
mi sento proprio negato!!

Potresti provare a campionare il segnale del telecomando usando un led IR collegato alla scheda audio del PC, studiare le temporizzazioni e poi farle riprodurre "a mano" ad Arduino:

Grazie ,
cercando un arduoscilloscopio ,ho trovato questo codice che metto sotto ,
legge frequenza e cambio di stato ora proverò a riprodurre quanto leggo

/*

  • File… IRanalyzer.pde
  • Purpose… Records up to 128 signal changes
  • Author… Walter Anderson
  • E-mail… wandrson@walteranderson.us
  • Started… 18 May 2007
  • Updated… 18 May 2007

*/
#include <avr/interrupt.h>
#include <avr/io.h>

#define TIMER_RESET TCNT1 = 0
#define SAMPLE_SIZE 64

int IRpin = 2;
unsigned int TimerValue[SAMPLE_SIZE];
char direction[SAMPLE_SIZE];
byte change_count;
long time;

void setup() {
Serial.begin(115200);
Serial.println(“Analyze IR Remote”);
TCCR1A = 0x00; // COM1A1=0, COM1A0=0 => Disconnect Pin OC1 from Timer/Counter 1 – PWM11=0,PWM10=0 => PWM Operation disabled
// ICNC1=0 => Capture Noise Canceler disabled – ICES1=0 => Input Capture Edge Select (not used) – CTC1=0 => Clear Timer/Counter 1 on Compare/Match
// CS12=0 CS11=1 CS10=1 => Set prescaler to clock/64
TCCR1B = 0x03; // 16MHz clock with prescaler means TCNT1 increments every 4uS
// ICIE1=0 => Timer/Counter 1, Input Capture Interrupt Enable – OCIE1A=0 => Output Compare A Match Interrupt Enable – OCIE1B=0 => Output Compare B Match Interrupt Enable
// TOIE1=0 => Timer 1 Overflow Interrupt Enable
TIMSK1 = 0x00;
pinMode(IRpin, INPUT);
}

void loop()
{
Serial.println(“Waiting…”);
change_count = 0;
while(digitalRead(IRpin) == HIGH) {}
TIMER_RESET;
TimerValue[change_count] = TCNT1;
direction[change_count++] = ‘0’;
while (change_count < SAMPLE_SIZE) {
if (direction[change_count-1] == ‘0’) {
while(digitalRead(IRpin) == LOW) {}
TimerValue[change_count] = TCNT1;
direction[change_count++] = ‘1’;
} else {
while(digitalRead(IRpin) == HIGH) {}
TimerValue[change_count] = TCNT1;
direction[change_count++] = ‘0’;
}
}
Serial.println(“Bit stream detected!”);
change_count = 0;
time = (long) TimerValue[change_count] * 4;
Serial.print(time);
Serial.print("\t");
Serial.println(direction[change_count++]);
while (change_count < SAMPLE_SIZE) {
time = (long) TimerValue[change_count] * 4;
Serial.print(time);
Serial.print("\t");
Serial.println(direction[change_count-1]);
Serial.print(time);
Serial.print("\t");
Serial.println(direction[change_count++]);
}
Serial.println(“Bit stream end!”);
delay(2000);
}

progressi?

Non particolari...

Da non programmatore sto facendo un po di collage a blocchi e guardando il linguaggio c.

purtroppo tra un esperimento e l'altro mi tocca lavorare... :smiley:

Fatto , se dovesse servire ....

int IRledPin = 14;
int CH_Shoot = 3;

void setup() {
// initialize the IR digital pin as an output:
pinMode(IRledPin, OUTPUT);

pinMode(CH_Shoot, INPUT);

// Serial.begin(9600);
}
long i = 0;

void readRCin(){
//Serial.print("Duration: ");
i = pulseIn(CH_Shoot, LOW);
i = (i -18000);
Serial.println(i);
}

void loop()
{
readRCin();
if (i > 600) {
SendNikonCode();
//Serial.println("Sending IR signal");
}
else{}

delay(20); // wait one minute (60 seconds * 1000 milliseconds)
}

void pulseIR(long microsecs) {

cli(); // this turns off any background interrupts

while (microsecs > 0) {
// 38 kHz is about 13 microseconds high and 13 microseconds low
digitalWrite(IRledPin, HIGH); // this takes about 3 microseconds to happen
delayMicroseconds(13); // hang out for 10 microseconds
digitalWrite(IRledPin, LOW); // this also takes about 3 microseconds
delayMicroseconds(13); // hang out for 10 microseconds

// so 26 microseconds altogether
microsecs -= 26;
}

sei(); // this turns them back on
}

void SendNikonCode() {
// This is the code for my particular Nikon, for others use the tutorial
// to 'grab' the proper code from the remote

pulseIR(3520);
delayMicroseconds(1640);
pulseIR(420);
delayMicroseconds(400);
pulseIR(480);
delayMicroseconds(1220);
pulseIR(440);
delayMicroseconds(420);
pulseIR(440);
delayMicroseconds(380);
pulseIR(460);
delayMicroseconds(400);
pulseIR(460);
delayMicroseconds(440);
pulseIR(420);
delayMicroseconds(400);
pulseIR(440);
delayMicroseconds(420);
pulseIR(440);
delayMicroseconds(400);
pulseIR(460);
delayMicroseconds(420);
pulseIR(440);
delayMicroseconds(420);
pulseIR(440);
delayMicroseconds(400);
pulseIR(440);
delayMicroseconds(400);
pulseIR(460);
delayMicroseconds(1260);
pulseIR(460);
delayMicroseconds(400);
pulseIR(440);
delayMicroseconds(400);
pulseIR(420);
delayMicroseconds(400);
pulseIR(460);
delayMicroseconds(440);
pulseIR(460);
delayMicroseconds(400);
pulseIR(440);
delayMicroseconds(400);
pulseIR(420);
delayMicroseconds(1240);
pulseIR(420);
delayMicroseconds(1260);
pulseIR(440);
delayMicroseconds(1260);
pulseIR(460);
delayMicroseconds(440);
pulseIR(420);
delayMicroseconds(420);
pulseIR(420);
delayMicroseconds(400);
pulseIR(460);
delayMicroseconds(420);
pulseIR(440);
delayMicroseconds(1260);
pulseIR(480);
delayMicroseconds(420);
pulseIR(440);
delayMicroseconds(1240);
pulseIR(460);
delayMicroseconds(400);
pulseIR(420);
delayMicroseconds(380);
pulseIR(420);
delayMicroseconds(400);
pulseIR(440);
delayMicroseconds(1260);
pulseIR(420);
delayMicroseconds(1260);
pulseIR(420);
delayMicroseconds(420);
pulseIR(420);
delayMicroseconds(440);
pulseIR(440);
delayMicroseconds(1260);
pulseIR(460);
delayMicroseconds(1260);
pulseIR(420);
delayMicroseconds(420);
pulseIR(420);
delayMicroseconds(400);
pulseIR(420);
delayMicroseconds(1260);
pulseIR(420);
delayMicroseconds(1260);
pulseIR(420);
delayMicroseconds(1280);
pulseIR(460);
delayMicroseconds(1260);
pulseIR(460);
delayMicroseconds(1260);
pulseIR(460);
delayMicroseconds(400);
pulseIR(460);
delayMicroseconds(400);
pulseIR(460);

delay(65); // wait 65 milliseconds before sending it again

pulseIR(3520);
delayMicroseconds(1640);
pulseIR(420);
delayMicroseconds(400);
pulseIR(480);
delayMicroseconds(1220);
pulseIR(440);
delayMicroseconds(420);
pulseIR(440);
delayMicroseconds(380);
pulseIR(460);
delayMicroseconds(400);
pulseIR(460);
delayMicroseconds(440);
pulseIR(420);
delayMicroseconds(400);
pulseIR(440);
delayMicroseconds(420);
pulseIR(440);
delayMicroseconds(400);
pulseIR(460);
delayMicroseconds(420);
pulseIR(440);
delayMicroseconds(420);
pulseIR(440);
delayMicroseconds(400);
pulseIR(440);
delayMicroseconds(400);
pulseIR(460);
delayMicroseconds(1260);
pulseIR(460);
delayMicroseconds(400);
pulseIR(440);
delayMicroseconds(400);
pulseIR(420);
delayMicroseconds(400);
pulseIR(460);
delayMicroseconds(440);
pulseIR(460);
delayMicroseconds(400);
pulseIR(440);
delayMicroseconds(400);
pulseIR(420);
delayMicroseconds(1240);
pulseIR(420);
delayMicroseconds(1260);
pulseIR(440);
delayMicroseconds(1260);
pulseIR(460);
delayMicroseconds(440);
pulseIR(420);
delayMicroseconds(420);
pulseIR(420);
delayMicroseconds(400);
pulseIR(460);
delayMicroseconds(420);
pulseIR(440);
delayMicroseconds(1260);
pulseIR(480);
delayMicroseconds(420);
pulseIR(440);
delayMicroseconds(1240);
pulseIR(460);
delayMicroseconds(400);
pulseIR(420);
delayMicroseconds(380);
pulseIR(420);
delayMicroseconds(400);
pulseIR(440);
delayMicroseconds(1260);
pulseIR(420);
delayMicroseconds(1260);
pulseIR(420);
delayMicroseconds(420);
pulseIR(420);
delayMicroseconds(440);
pulseIR(440);
delayMicroseconds(1260);
pulseIR(460);
delayMicroseconds(1260);
pulseIR(420);
delayMicroseconds(420);
pulseIR(420);
delayMicroseconds(400);
pulseIR(420);
delayMicroseconds(1260);
pulseIR(420);
delayMicroseconds(1260);
pulseIR(420);
delayMicroseconds(1280);
pulseIR(460);
delayMicroseconds(1260);
pulseIR(460);
delayMicroseconds(1260);
pulseIR(460);
delayMicroseconds(400);
pulseIR(460);
delayMicroseconds(400);
pulseIR(460);

}