|
Re: How do you program limit switches?
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?
__________________
If it's green and slimy, it's Biology.
If it smells, it's Chemistry.
If it doesn't work, it's Physics.
- My Physics Teacher
Fixed:
If it doesn't work, it's our Robot up until that last few days of the build season.
|