This commit is contained in:
2024-10-21 12:34:03 +02:00
parent 9935375a5a
commit 79f21f8755

View File

@@ -14,11 +14,11 @@ int main()
{ {
unsigned char *null_ptr(0); unsigned char *null_ptr(0);
robot.startCommunication("/dev/ttyUSB0", true, null_ptr); robot.startCommunication("/dev/ttyUSB0", true, null_ptr);
sleep(1);
std::thread safety([&robot]() { robot.robotSafety(); }); // use a lambda function to call the member function std::thread safety([&robot]() { robot.robotSafety(); }); // use a lambda function to call the member function
safety.detach(); safety.detach();
thread movementThread(movement);
thread movementThread(movement);
movementThread.join(); //so the program doesnt quit movementThread.join(); //so the program doesnt quit
return 0; return 0;
} }
@@ -47,7 +47,7 @@ int movement()
else if (text == 2) else if (text == 2)
{ {
// 1 is full circle // 1 is full circle
robot.doRotation(0.25); robot.Rotate(90);
} }
else if (text == 3) else if (text == 3)
{ {