diff --git a/server/commande_telephone.ino b/server/commande_telephone.ino index cbb65aa..2820cde 100644 --- a/server/commande_telephone.ino +++ b/server/commande_telephone.ino @@ -59,7 +59,8 @@ void loop() return; // Arrêter le robot si une commande est interrompue - if (stopCommand) + // ou si le nombre de pas a été effectué + if (stopCommand || globalValue <= 0) { Serial.println("stop"); commandRunning = false; @@ -77,13 +78,6 @@ void loop() Serial.println(globalValue); globalValue--; } - else - { // Sinon on stoppe les moteurs - Serial.println("stop"); - commandRunning = false; - stopCommand = false; - stopMotors(); - } } // Configuration du serveur asynchrone