How to use Drivertain.turnTo() function?

I’m not a native English speaker, so I’m sorry for my poor English.
My robot car keeps spinning in place when “Drivertain.turnTo(right, 90, degrees, )” runs.
I have installed the inertial sensor and motor on my robot car and set them correctly.
Is there any other sensor I need to install?

a couple questions:

does the robot turn to the right or the left when this code is ran?

if you pick up the robot as it starts to turn, and spin it the other way, does it stop running?

is your inertial sensor plugged into the right port and have a solid red light when plugged in?

The answers for the questions

  1. The robot turn to the right.
  2. I haven’t tried
  3. Yes.I’m sure my inertial senser plugged into the right port and work correctly

have you already tried to start the command task::sleep(500);?
so that the robot rests and processes the information of the syntax that you created for the autonomous.
It has happened to me that my robot did not put that instruction and it starts to dance like crazy

Thanks, I tried it and my robot is working pretty good now!