PLEASE HELP :self balancing robot with uno + l298nh motor shield and mpu6050

HI EVERY ARDUINO MASTERS:

I RECENTLY MAKING A PROJECT BUT THE WHEELS JUST COME ONE DIRECTION WHEN I TILT TO RIGHT,AND WHEELS STOP WHEN I TILT TO ANOTHER DIRECTION.

THE CODE AND IMAGE HAVE BEEN ATTACHED HERE.

THANKS VERY MUCH ADVANCE.

HANDIS

Balancing_robot.ino (17.2 KB)

Before you had a monster 17kB sketch, you had a simple test sketch that simply moved the motors backwards and forwards at different speeds, in response to basic serial commands.

That worked ok, right?

And please don't SHOUT.

hi
the sketch came from youtuber, i just download and using the same method, but it doesn't work. have a look in it when u have time.
many thanks

handis:
but it doesn't work.

That really does not tell us much.
So far, you have given us that the wheels turn when you tilt one direction and the wheels stop when you tilt the other direction.
Is this what you expect?
Is it different that what you expect? If so, detail for us how it is different.

have a look in it when u have time.

Actually, it will be much more effective for you to do the research.
In the very first reply, TheMemberFormerlyKnownAsAWOL asked if you had written a small sketch to determine if you can make the motors work. Forward, backwards and at several speeds.
Have you done this? It is very good advice. You should be able to write a very small sketch using the motor commands from your youtube code. If you run into problems, post your small motor control code here using code tags, describe what is wrong and we can jump in.

THE VIDEO IS IN ZIP FILE.
PLEASE HAVE A LOOK. THE CODE HERE IS DIRECT COPIED FROM ANOTHER PROJECT MAKER. I JUST CHANGED THE FIGURE OF THE BALANCING POINT.
OTHERS STAY THE SAME.

Video.zip (1.93 MB)

handis, did you read the replies above at all?

We are not interested in your large sketch that you copied from somewhere.
In Reply #1, do you see where the suggestion is made to create a "simple test sketch that simply moved the motors backwards and forwards at different speeds"?
Have you tired that?

It was suggested because that it the best way for us to determine if you have the motors and controller working properly.
Please do this. It is really the best way to move forward.

Also, please do not write in all caps. It is the same as shouting in real life and if generally considered rude.
This was also covered in reply #1.

Hi Vinceherman
First of all, thanks very much for your suggestion, and i did check my motor shield separately with different code, and it works perfectly.
I have a noidea to identify the problem. i think the mpu6050 unit is fine. but the code itself may not work porperly.
.that is the reason i come here for help and learn .

thanks again..

have a nice day

the motor shield is L298P.
i upload the code to check mpu6050 and nothing wrong with it

the sketch came from youtuber, i just download and using the same method, but it doesn't work. have a look in it when u have time.

This is not how it works here. You don't download code done by someone else and post it here for us to check why it doesn't work. You build up the code yourself, bit by bit. And each bit, that doesn't work, we can try to help you with.