Buongiorno e buona domenica a tutti! ![]()
Stavo provando a realizzare quanto descritto in questo tutorial: Using an IR Sensor | IR Sensor | Adafruit Learning System
So che questo è un tutorial provato da molti qui, per questo spero che qualcuno mi possa aiutare ![]()
Diciamo comunque che è un sistema per decifrare un codice IR dato da un telecomando e replicarlo.
Lo sto provando per la mia macchina fotografica, per realizzare qualcosa di simile a quanto descritto nelle pagine seguenti del link che vi ho indicato.
Purtroppo, non so perchè, ma le letture del telecomando risultano sempre diverse e provando lo sketch per trasmettere gli impulsi tramite diodo IR ... non funziona ![]()
Non so se possa dipendere dal sensore IR che uso o da cos'altro... mi servirebbe un aiuto per far funzionare il tutto o, magari, se qualcuno ha già i codici IR per una canon 5d mkII (ma andrebbero bene anche i codici per far scattare un flash 580 exII) , potrei provare con quelli ![]()
intanto allego uno screenshot delle diverse letture ottenute tramite il pulsante del telecomando e lo sketch da me modificato nei valori per dare gli impulsi
... poi, scusate la domanda... ma come mai si da per scontato che tutto funzioni a 38 KHz? (ho Arduino da meno di un mese... abbiate pietà per il mio livello tecnico/pratico)
Grazie infinite a quanti vorranno aiutarmi ;D
// This sketch will send out a Nikon D50 trigger signal (probably works with most Nikons)
// See the full tutorial at http://www.ladyada.net/learn/sensors/ir.html
// this code is public domain, please enjoy!
int IRledPin = 13; // LED connected to digital pin 13
// The setup() method runs once, when the sketch starts
void setup() {
// initialize the IR digital pin as an output:
pinMode(IRledPin, OUTPUT);
Serial.begin(9600);
}
void loop()
{
Serial.println("Sending IR signal");
SendNikonCode();
delay(60*1000); // wait one minute (60 seconds * 1000 milliseconds)
}
// This procedure sends a 38KHz pulse to the IRledPin
// for a certain # of microseconds. We'll use this whenever we need to send codes
void pulseIR(long microsecs) {
// we'll count down from the number of microseconds we are told to wait
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(10); // hang out for 10 microseconds, you can also change this to 9 if its not working
digitalWrite(IRledPin, LOW); // this also takes about 3 microseconds
delayMicroseconds(10); // hang out for 10 microseconds, you can also change this to 9 if its not working
// 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(560);
delayMicroseconds(7000);
pulseIR(540);
}/code]

