EasyC - robot turns 180-degrees

Dumb question - How do you program the motors to do a simple 180-degree turn? I would think if you set the Wait function to be too long, the robot will turn more than 180-degrees. How do you know how long to run the Left and Right motors so it will just turn the robot around 180-degrees?

Do you have shaft encoders? If so, you can determine how many wheel revolutions it takes to rotate the robot 180 degress and set your motors to run until the shaft encoder reading reaches that amount.

If you are doing all of your control using time you will just have to test different amounts of time. Also remember different battery charges will result in different times required.

Okay. So its not as easy as I thought in EasyC to code a simple 180-degree turnaround by a robot?

Even if you could tell the motor to turn a specific number of degrees EasyC would have to know the exact dimensions of the robot, size of the wheels and gearing to make that happen. It’s just a problem that sounds really easy for humans but is a lot harder for computers.

Thanks so much Griffin! I’m new to VEX programming and I don’t know what I don’t know, if you know what I mean! Thanks for helping~

Happy to help. Ya with robotics you have to really think through every step and what is required, it is just part of learning.
:slight_smile: