View Single Post
  #2   Spotlight this post!  
Unread 05-02-2016, 18:38
Ben Wolsieffer Ben Wolsieffer is offline
Dartmouth 2020
AKA: lopsided98
FRC #2084 (Robots by the C)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Manchester, MA (Hanover, NH)
Posts: 519
Ben Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud of
Re: am-2899 Absolute Encoder

The Encoder class is for a quadrature encoder, which is why it uses two DIO ports (not PWM). The encoder you linked needs to be connected to an analog input. Its output voltage is proportional to the angle.

Here is some psuedo-Java that could be used to get an angle:
Code:
AnalogInput encoder = new AnalogEncoder(0);

double angle = (encoder.getVoltage() / 5.0) * 360.0;
You could also try looking at AnalogPotentiometer, which can do the scaling for you.
__________________



2016 North Shore District - Semifinalists and Excellence in Engineering Award
2015 Northeastern University District - Semifinalists and Creativity Award
2014 Granite State District - Semifinalists and Innovation in Control Award
2012 Boston Regional - Finalists
Reply With Quote