From 7449f713fabc9cbf8554c37c1e0e317e9d2f6526 Mon Sep 17 00:00:00 2001 From: Sam Hos Date: Mon, 4 Nov 2024 11:55:20 +0100 Subject: [PATCH] added breaks --- src/C++/Driver/src/main.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/C++/Driver/src/main.cpp b/src/C++/Driver/src/main.cpp index d626ebe..9e019b3 100644 --- a/src/C++/Driver/src/main.cpp +++ b/src/C++/Driver/src/main.cpp @@ -48,15 +48,19 @@ std::string readMQTT() void parseMQTT(std::string message){ if(message == "up"){ robot.forward(600); + break; } else if(message == "left"){ robot.Rotate(90); + break; } else if(message == "down"){ robot.Rotate(-90); + break; } else{ std::cout << "Invalid command" << std::endl; + break; } }