Quote:
Originally Posted by GoldenGollem
First off, thanks Engunner for the idea of using booleans to organize the code. I am using one limit switch to stop the motor from moving too far in the reverse. I am, however having issues with
Code:
if (intakeMotorForward && !limitSwitch ) {
It is showing that there is and error there.
|
There are 2 simple problems with your code.
First,
On top, where you declared
Code:
DigitalInput limitSwitch;
change to
Code:
DigitalInput limitSwitch = new DigitalInput(x);
where x is the port number where your limit switch is plugged in at the DIO part of the roborio
Second,
It's not just
You need to use
Which gets you the boolean value of the limit switch which may be true or false depending if you wired it as normally opened or normally closed.