mirror of
https://gitlab.fdmci.hva.nl/technische-informatica-sm3/ti-projectten/rooziinuubii79.git
synced 2025-08-04 04:14:58 +00:00
attempt to fix
This commit is contained in:
@@ -23,7 +23,6 @@ void setup(){
|
|||||||
|
|
||||||
int main(){
|
int main(){
|
||||||
setup();
|
setup();
|
||||||
client.run();
|
|
||||||
while(true){
|
while(true){
|
||||||
parseMQTT(readMQTT());
|
parseMQTT(readMQTT());
|
||||||
cout << readMQTT() << endl; //debugging
|
cout << readMQTT() << endl; //debugging
|
||||||
@@ -48,19 +47,15 @@ std::string readMQTT()
|
|||||||
void parseMQTT(std::string message){
|
void parseMQTT(std::string message){
|
||||||
if(message == "up"){
|
if(message == "up"){
|
||||||
robot.forward(600);
|
robot.forward(600);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
else if(message == "left"){
|
else if(message == "left"){
|
||||||
robot.Rotate(90);
|
robot.Rotate(90);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
else if(message == "down"){
|
else if(message == "down"){
|
||||||
robot.Rotate(-90);
|
robot.Rotate(-90);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
std::cout << "Invalid command" << std::endl;
|
std::cout << "Invalid command" << std::endl;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user