Too little information to be able to help you. How is this an Arduino question ( this is not a C# forum)? What obstacle sensor?
Read the how to use this forum sticky to see how to post code and some advice on what we need to know in order to offer intelligent assistance. See #7 & 11 especially.