dc motor control using gyro

how to control dc motors with the output of gyro sensor GY-521 to make an inverted pendulum please help me with the code

Is Google broken today? I'm sure you could type that same phrase in and get a useful result. (No, you didn't even write a complete sentence.)