Quote:
Originally Posted by shank948
Use a DigitalInput. It should be declared as a static variable, like this:
public static DigitalInput limitSwitch;
Initialize it like this:
limitSwitch = new DigitalInput(slot,channel);
To use the limit switch, call the get() method on it, which, assuming you have it wired correctly, will return true if the switch is closed and false if it is open.
Any more questions?
|
ok, so for the constructor. I pass the slot that it's plugged into on the DigitalIO for the slot, but what do I pass for channel?