From 2ccde493d6cee1854d251f126c7f77d9e2d26421 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Abonnel?= Date: Sun, 15 May 2022 18:31:34 +0000 Subject: [PATCH] Update Update sketchDistanceSerial.ino --- arduino/Update sketchDistanceSerial.ino | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arduino/Update sketchDistanceSerial.ino b/arduino/Update sketchDistanceSerial.ino index 0b8a008..6d643f6 100644 --- a/arduino/Update sketchDistanceSerial.ino +++ b/arduino/Update sketchDistanceSerial.ino @@ -21,13 +21,13 @@ void loop() { int ping(int TriggerPin, int EchoPin) { long duration, distanceCm; - digitalWrite(TriggerPin, LOW); //Pause de 4 µs + digitalWrite(TriggerPin, LOW); //Démarrage de la séquence de 4 µs delayMicroseconds(4); - digitalWrite(TriggerPin, HIGH); //Génération de 10 µs + digitalWrite(TriggerPin, HIGH); // Impulsion de déclenchement 10 µs delayMicroseconds(10); - digitalWrite(TriggerPin, LOW); //Pause + digitalWrite(TriggerPin, LOW); // Arrêt de l'impulsion - duration = pulseIn(EchoPin, HIGH); // lecture + duration = pulseIn(EchoPin, HIGH); // Émission du signal et lecture distanceCm = duration * 10 / 292/ 2; // Vitesse du son converti en cm return distanceCm;