In the example above, the change from running forward to turn left/right is not smooth.

You might try to set one motor to speed +50 and the other to +100 to make smoother turns.
It may be that 50 is not enough power to turn the wheel, try higher value such as 75 then.
Depending on how narrow the line bends, you need another ratio between slow and fast motor, maybe 50 to 125. Try it yourself.

Hi Andreas! Thanks for your answer, but it did not work well. I mean the mBot doesn’t turn smoothly as the original codes which comes in it. When I checked the original codes before I changed, they were in an .ino file (Arduino). So I couldn’t understand well.