Need Help on how to control 2 wheel auto balancing robot

Hello everyone,

I need help on how to control the movement (forward, bakward, turn left, turn righ) of the 2 wheel auto balancing robot. I am using arduino uno, l298n, 2 ultra sonic sensor and mpu6050. I want to build an autobalancing robot that can follow you everywhere you go but i don't know the coding. I found codes on the internet but it is just to autobalance the robot and I don't have codes to control it. Is there anyone who could help me on coding the movement of the robot?

I would appreciate any help! thanks!

Were you able to make your robot balance using the codes you found?

If not, that would be a good starting point.