From bd65fc08e39bfd63a9da3cd70883fee811982756 Mon Sep 17 00:00:00 2001 From: dd060606 Date: Thu, 8 May 2025 19:17:20 +0200 Subject: [PATCH] =?UTF-8?q?Ajout=20d'une=20v=C3=A9rification=20des=20obsta?= =?UTF-8?q?cles=20uniquement=20lorsque=20le=20robot=20n'est=20pas=20en=20r?= =?UTF-8?q?otation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 63d4075..c53ba60 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -137,6 +137,12 @@ void detectObstacles() { lastObstacleCheckTime = now; + // Si le robot tourne sur lui-même, on ne vérifie pas les obstacles + if (lastDirection == RIGHT || lastDirection == LEFT) + { + return; + } + long distance = readDistanceCM(); if (distance > 0 && distance < obstacleThresholdCM)