threaded the movement of the robot

This commit is contained in:
2024-09-24 14:41:20 +02:00
parent a49800ca51
commit 5badea0c32

View File

@@ -16,6 +16,7 @@ int main()
cout << "Enter commando"; cout << "Enter commando";
thread mv(movement); thread mv(movement);
usleep(30 * 1000 * 1000); usleep(30 * 1000 * 1000);
mv.join(); //only exit once thread one is done running
} }
int checkCenterCliff() int checkCenterCliff()
@@ -35,7 +36,7 @@ int movement()
if (text == 1) if (text == 1)
{ {
robot.goStraight(1); robot.goStraight(10);
} }
else if (text == 2) else if (text == 2)
{ {