This is the LabVIEW subforum.
It depends on what sensor you are using and which input-analog, I2C, SPI, etc.
In general, you will measure the value returned by the sensor for 10 inches, then use a case statement that:
- Drives the motors forward while the value is greater than 10 inches
- Reverses the motor on one side when the value is 10 inches or less