View Single Post
  #3   Spotlight this post!  
Unread 02-02-2016, 05:38 PM
ozrien's Avatar
ozrien ozrien is offline
Omar Zrien
AKA: Omar
no team
Team Role: Mentor
 
Join Date: Sep 2006
Rookie Year: 2003
Location: Sterling Heights, MI
Posts: 516
ozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant future
Re: comparing encoder input against an integer

If you are using quadrature encoders connected to the RIO, you should follow the example code under "Getting Encoder Values".
https://wpilib.screenstepslive.com/s...or-other-shaft

If you are using quad encoders connected to the Talon SRX, follow the examples in the Talon SRX SOftware Reference Manual.

If you are using analog encoder (like MA3) connected to RIO you need to create an analogInput.

But regardless DigitInput is not the correct class. Also in your example enc is a pointer to an object, which has member functions which are typically called to get useful information.
Reply With Quote