From 0c1ea5dbc0bb7ff9e31d90d8786b10bbb79c0827 Mon Sep 17 00:00:00 2001 From: ackimixs Date: Tue, 16 Apr 2024 18:05:45 +0200 Subject: [PATCH] change loop --- TCPServer.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/TCPServer.cpp b/TCPServer.cpp index 4c8d74a..a35d676 100644 --- a/TCPServer.cpp +++ b/TCPServer.cpp @@ -397,13 +397,15 @@ void TCPServer::startGame() { // pi/4 this->broadcastMessage("strat;arduino;angle;314\n"); - isRobotMoving = true; - while (this->isRobotMoving) { - usleep(500'000); + isRobotMoving = 0; + while (this->isRobotMoving < 3) { + usleep(200'000); this->broadcastMessage("strat;arduino;get state;1\n"); } usleep(500'000); + // ReSharper disable once CppDFAUnreachableCode + usleep(500'000); this->broadcastMessage("strat;servo_moteur;baisser bras;1\n");