balancing robot

i'm doing a self balancing robot for my final project and i want to control it via bluetooth using an android application i have a bluetooth module HC-05. can anyone help me with the code how to control it with left,right,forward and backward command without loosing it's balance.

Is Google broken in your country ?

You need to break this down into smaller tasks.

First write an android app with four buttons that sends bluetooth. Or download one - I'm sure there's an android "configurable bluetooth tv remote" app that will do what you want.

Next, write a sketch that does nothing but sucessfully listen to your android app and print out to the serial monitor when a button is pressed.

Wire up four butttons to your robot (left, right, back, forward). And make your robot go. Make sure that your code is written in terms of a general "sense if it's time to go left" function, rather than tying it to specific pins.

Put the bluetooth stuff into your robot sketch in place of the wired-in buttons.

Hope this helps!

Assuming you already have the balancing part worked out, there are a couple of ways you can move forward. You could 1) add a static offset to your gyro reading or, 2) add a static voltage to your motors. You can turn by adding a differential static voltage to your motors. In other words, you just superimpose your motion on top of the corrections determined by your closed loop balance control.