Re: Touch Sensor not working?
This particular issue was caused by the second while loop not having any braces to encapsulate which code it should control.
If there aren't any braces following a loop or if statement's condition, the loop or if statement will look for the next single line of code to 'control', in this case the 'motor[frontRightMotor] = 127;' command. So, instead of doing nothing while the touch sensor was pressed (which was the intention of the program, to have a 'wait until bump' command to start the program) the program would turn on the frontRightMotor at a power level of 127.
The correct code is:
Check out our Blog
! And our Facebook page
Need help? Take a look at our updated help documentation
and the ROBOTC Forums.