|
Re: Issues with LimitSwitch
> while (counter.get() > 0)
You never initialize the counter. While that may be ok, I suggest doing that in RobotInit, just in case. At a minimum, I think you have to tell it which DIO channel to watch.
However, it doesn't really do anything in your code. It counts the number of presses, so it should always be >0 after the first press. You either want to see if it is pressed, or not. It doesn't do you much good to count the number of times it is pressed.
Last edited by rich2202 : 16-02-2016 at 10:35.
|