From 9aee138130abe1a2ac2e00d3da52e5bf29dac5bd Mon Sep 17 00:00:00 2001 From: ackimixs Date: Tue, 21 May 2024 22:26:21 +0200 Subject: [PATCH] shouldStop --- main.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/main.cpp b/main.cpp index 1720bd5..f668745 100644 --- a/main.cpp +++ b/main.cpp @@ -47,13 +47,12 @@ int main(int argc, char* argv[]) { int lastEtat = digitalRead(TIRETTE_GPIO); // Boucle principale - while (!client.shouldStop()) { + while (!client.shouldStop() && !shouldStop) { int etat = digitalRead(TIRETTE_GPIO); if (etat == LOW) { client.setTiretteState(true); - } else - { + } else { client.setTiretteState(false); if (lastEtat != etat) { // std::cout << "LETSGO" << std::endl;