View Single Post
  #2   Spotlight this post!  
Unread 02-15-2016, 01:36 AM
TimTheGreat's Avatar
TimTheGreat TimTheGreat is offline
ArchdukeTim
FRC #1418 (Vae Victis)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2011
Location: Falls Church
Posts: 232
TimTheGreat has a spectacular aura aboutTimTheGreat has a spectacular aura aboutTimTheGreat has a spectacular aura about
Re: Coding a am-2816a motor encoder.

Quote:
Originally Posted by FireAmpersand View Post
First off is the wires go back to the roboRIO or straight to the Talon srx (CAN).
So the wires go to a talon Encoder Breakout board. You can find the wiring specifications on the andymark encoder description page.

In code, change the control mode of the motor
Code:
motor.changeControlMode(CANTalon.TalonControlMode.Position)
To get the sensor feedback you can view it in networktables by adding
Code:
motor.get()
and to set the motor to a certain encoder position

Code:
motor.set(int encValue)
__________________
There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.



2012 - Gracious Professionalism - Greater DC
2014 - Regional Finalist - Virginia | Industrial Design - Virginia | Regional Finalist - Greater DC
2015 - Innovation in Control - Greater DC
2016 - District Event Winner - VAHAY | Innovation in Control - VAHAY | District Event Winner - MDBET | Industrial Design - MDBET | District Champion - CHCMP | Innovation in Control - CHCMP
Reply With Quote