I make a project with 2 DC motors to walk through a maze . I need to how to set the angle of rotation to be 90 degrees.
What to use and how to implement it in the Arduino code ?
Have you asked your teacher if you can use forum help?
If you have quadrature encoders in your motors use that.
If you rotate in place rotate right motors n. steps in one direction and left motors n. steps in opposite direction ( you have to test how meny steps )
If not you can use something like a magnetometer
How is the controller measuring the angle ?
Are the motors geared ?
Maybe a drawing of your mechanical setup, and your current code would help us help you.
More questions later,
You'll need a position sensor or rotary encoder to "know" the position of a regular DC motor. The same goes for speed.
Stepper motors move in discrete steps, usually 1.8 degrees per step, and the software can keep track of the steps and know the position (assuming the software knows the starting position and assuming no "slipping".) Usually a stepper motor (or stepper mechanism) needs a "home" sensor to find the starting position and sometimes you need an "end" sensor, etc.
Servo motors are angle motors (they rotate less than 360 degrees) and they have a position sensor (a pot) built-in, and they have a built-in driver circuit.
You can measure the rotation of the wheels in a number of ways, but unless the two wheels are of exactly the same diameter, or you compensate for any differences, and the wheels don't slip on the surface it will do you no good
Try the motor examples here...
One approach is to use an electronic compass (magnetometer) to determine the heading. The magnetometer must be calibrated after mounting on the robot.