Thread: Encoder Issues
View Single Post
  #4   Spotlight this post!  
Unread 16-01-2016, 14:55
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: 521
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: Encoder Issues

Hey feoniks4505,

The Encoder class is for encoders wired to the roboRIO...
Code:
sensorscanEncoder = new Encoder(0, 1, false, EncodingType.k4X);
I think motorsCANTalon.getPosition() and motorsCANTalon.getSpeed() are what you want. Remember the sensor data comes from the Talon, to the RIO, which is where your code runs.

Checkout section 5.3 in the Talon SRX Software reference manual to see all the getters.

And when you are ready to use the internal closed-loop features of the Talon, check out the examples in section 12.

Also for the future, if anyone has a doubt of wiring-issue-versus-software-issue, use the self-test feature (Section 2.4) to see what the Talon sees for sensor data. Then you can rule out wiring versus software. Self-test works even if there is no-code.
Reply With Quote