View Single Post
  #3   Spotlight this post!  
Unread 16-02-2016, 18:49
Lesafian Lesafian is offline
Registered User
AKA: Jeremy Styma
FRC #6077 (Wiking Kujon)
Team Role: Programmer
 
Join Date: Feb 2016
Rookie Year: 2016
Location: Posen, Michigan
Posts: 22
Lesafian is an unknown quantity at this point
Re: Issues with LimitSwitch

Quote:
Originally Posted by rich2202 View Post
> 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.
How would this be possible?
Reply With Quote