Here is the code I have written for autonomous. I want the robot to stop and the piston to extend when the ultrasonic sensor reads 40 inches. But it doesnt happen. We have tested the ultrasonic sensor and tuned it. We are sure that the distance ultrasonic sensor reads is true.
Can anyone tell me if the code is correct or wrong?
Thanks in advance.
http://imageshack.us/photo/my-images...tonomous2.png/
http://imageshack.us/photo/my-images...utonomous.png/