Ligne 27 : |
Ligne 27 : |
| [[Image:IR-INTERVAL-3.jpg]] | | [[Image:IR-INTERVAL-3.jpg]] |
| | | |
− | Looks like the data sent is:
| + | Il semble que les données envoyées soient: |
− | | |
− | suite ici [http://learn.adafruit.com/ir-sensor/making-an-intervalometer]
| |
| | | |
| {| class="wikitable" border="1" | | {| class="wikitable" border="1" |
Ligne 52 : |
Ligne 50 : |
| |} | | |} |
| | | |
− | If you look closely you'll see its actually just
| + | Et si vous faite bien attention, cette séquence se résume vraiment à: |
| | | |
| {| class="wikitable" border="1" | | {| class="wikitable" border="1" |
Ligne 67 : |
Ligne 65 : |
| |} | | |} |
| | | |
− | sent twice. Sending the same signal twice is very common - doubling up to make sure it gets received
| + | Le séquence est envoyée deux fois. |
| + | |
| + | Envoyer le même signal deux fois est assez courant - le fait de doubler le signal augmente fortement les chances qu'il soit reçu. |
| | | |
− | Next up we'll need to connect an IR 940nm LED to the output of the Arduino
| + | Ensuite, nous avons besoin de connecter une LED InfraRouge 940nm sur la sortie de notre Arduino. |
| | | |
| [[Image:IR-INTERVAL-4.jpg]] | | [[Image:IR-INTERVAL-4.jpg]] |
| | | |
− | Then we'll write a sketch which will pulse pin #13 on and off very fast in the proper code sequence.
| + | Ensuite, nous écrivons un petit sketch qui pulsera la pin #13 (allumer/éteindre vraiment très rapidement pour envoyer la bonne séquence de code ). |
| | | |
| <nowiki> | | <nowiki> |
| + | // Ce sketch envoi le va envoyer le signal de déclenchement à un Nikon D50 |
| + | // (Cela fonctionnera probablement avec la plupart des Nikons) |
| + | // Voir le tutoriel complètement traduit en Français (avec aimable autorisation |
| + | // d'AdaFruit Industries) |
| + | // |
| + | // http://mchobby.be/wiki/index.php?title=Senseur_IR |
| + | // |
| + | // Voir le Tutoriel complet (orginal, en anglais) sur |
| + | // http://www.ladyada.net/learn/sensors/ir.html |
| + | // |
| + | // Ce code est dans le domaine public, bonne amusement! |
| | | |
− | | + | int IRledPin = 13; // LED IR connectée à la sortie digitale 13 |
− | // This sketch will send out a Nikon D50 trigger signal (probably works with most Nikons)
| + | // La fonction setup() est exécutée une fois seulement, quand le sketch démarre |
− | // 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() { | | void setup() { |
− | // initialize the IR digital pin as an output:
| + | // Initialiser la sortie digitale de la LED infrarouge COMME SORTIE DIGITAL |
− | pinMode(IRledPin, OUTPUT);
| + | pinMode(IRledPin, OUTPUT); |
− | Serial.begin(9600);
| + | Serial.begin(9600); |
| } | | } |
| + | |
| void loop() | | void loop() |
| { | | { |
− | Serial.println("Sending IR signal");
| + | Serial.println("Envoi du signal IR"); |
− | SendNikonCode();
| + | SendNikonCode(); |
− | delay(60*1000); // wait one minute (60 seconds * 1000 milliseconds)
| + | delay(60*1000); // Attendre une minute (60 secondes * 1000 millisecondes) |
| } | | } |
− | // This procedure sends a 38KHz pulse to the IRledPin | + | |
− | // for a certain # of microseconds. We'll use this whenever we need to send codes | + | // Cette procedure envoi une pulsation à 38KHz sur le broche IRledPin |
| + | // durant un certain nombre de micro-secondes. |
| + | // Nous utilisons cette procédure partout où il faut envoyer un code. |
| void pulseIR(long microsecs) { | | void pulseIR(long microsecs) { |
− | // we'll count down from the number of microseconds we are told to wait
| + | // décompter le nombre de microsecondes qu'il faut attendre. |
− | cli(); // this turns off any background interrupts
| + | cli(); // désactive le traitement des interruption en tâche de fond. |
− | while (microsecs > 0) {
| + | while (microsecs > 0) { |
− | // 38 kHz is about 13 microseconds high and 13 microseconds low
| + | // 38 kHz équivaut a peu près à 13 microsecondes "high" et 13 microsecondes "low" |
− | digitalWrite(IRledPin, HIGH); // this takes about 3 microseconds to happen
| + | digitalWrite(IRledPin, HIGH); // prends +/- 3 microsecondes d'exécution |
− | delayMicroseconds(10); // hang out for 10 microseconds, you can also change this to 9 if its not working
| + | delayMicroseconds(10); // attendre 10 microsecondes de plus (peut aussi être changé en 9 si ne fonctionne pas correctement) |
− | 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
| + | digitalWrite(IRledPin, LOW); // Prends aussi 3 microsecondes |
− | // so 26 microseconds altogether
| + | delayMicroseconds(10); // attendre 10 microsecondes de plus (peut aussi être changé en 9). |
− | microsecs -= 26;
| + | |
− | }
| + | // Le tout fait 26 microsecondes |
− | sei(); // this turns them back on
| + | microsecs -= 26; |
| + | } |
| + | sei(); // réactive le traitement des intérruptions (traitement en tâche de fond) |
| } | | } |
| + | |
| void SendNikonCode() { | | void SendNikonCode() { |
− | // This is the code for my particular Nikon, for others use the tutorial | + | // Voici le code pour le Nikon utilisé dans ce tutorial. Pour d'autres utilisations, |
− | // to 'grab' the proper code from the remote | + | // il faudra capturer le code de la télécommande |
| pulseIR(2080); | | pulseIR(2080); |
| delay(27); | | delay(27); |
Ligne 120 : |
Ligne 133 : |
| delayMicroseconds(3440); | | delayMicroseconds(3440); |
| pulseIR(480); | | pulseIR(480); |
− | delay(65); // wait 65 milliseconds before sending it again | + | delay(65); // attendre 65 millisecondes avant de ré-envoyer le signal a nouveau |
| pulseIR(2000); | | pulseIR(2000); |
| delay(27); | | delay(27); |