Author Topic: Adding the ABS Encoder  (Read 2170 times)

Brayden L

  • Guest
Adding the ABS Encoder
« on: February 18, 2017, 12:10:05 PM »
cANTalon1.setEncPosition((int) (((double)analogInput1.getValue()-ZERO1)/ (4000) *1657));
cANTalon2.setEncPosition((int) (((double)analogInput2.getValue()-ZERO2)/ (4000) *1657));
cANTalon3.setEncPosition((int) (((double)analogInput3.getValue()-ZERO3)/ (4000) *1657));
cANTalon4.setEncPosition((int) (((double)analogInput4.getValue()-ZERO4)/ (4000) *1657));

Essentially:

CanTalon set Encoder Postition  = (cast to int) [ (absolute encoder value - zero position value) divided by 4000 * 1657]