|
Re: Minimum Flywheel Encoder CPR
Quote:
Originally Posted by fovea1959
Ah, now I *think* I understand. Once I say .ConfigEncoderCodesPerRev(3) [which is correct, 12 transitions per rev is 3 cycles or counts per rev), then the .set() method works in RPM.
If I don't call .ConfigEncoderCodesPerRev(), then .set() works in the silly transitions / 100ms units.
Do I have that correct?
|
Yes, that is correct.
I would avoid leveraging the internal unit scaling, though, because some of the other lower level functions (e.g. getEncVelocity) will still return in native units/100ms and mixing units is a recipe for confusion. Just do the unit scaling in your own code - you need only write two methods (RPMToNative and nativeToRPM), and you will never have any doubt about what units a variable is in.
__________________
"Mmmmm, chain grease and aluminum shavings..."
"The breakfast of champions!"
Member, FRC Team 449: 2007-2010
Drive Mechanics Lead, FRC Team 449: 2009-2010
Alumnus/Technical Mentor, FRC Team 449: 2010-Present
Lead Technical Mentor, FRC Team 4464: 2012-2015
Technical Mentor, FRC Team 5830: 2015-2016
|