ultrasonic sensors works fine until i merge codes into it

You obviously failed to read this, or if you did, failed to follow the guidelines. Until you do, we can't offer much if any help.