How to do dynamic programming

Os : windows 10.(extra information if needed)

I am using an IMU and i want to turn my bot right until a specific angle is achieved. But i dont want the angle to be hardcoded. How can i program so that I can give input from computer every time it performs the task. Please help.

Serial Input Basics - updated can give you some ideas how to do this. You might want to store the angle in eeprom so it is remembered after reset.

So your arduino controlling the IMU (Inertia Measurement Unit) is always connected through USB to your PC? Use the serial console to send something, wait for that value in your code and once received do the action and go wait again.

If not connect a joystick, a rotary encoder, any sort of a potentiometer/anything giving a variable voltage input that is user controlled to your arduino and read (analogRead) that value and map that to an angle.

If you can choose only from a few angles then a dip switch can also help code the information