|
Re: potentiometer code
Part of the beta testing has included a new potentiometer class. It's basically a wrapper around an analog input that lets you specify the degrees per volt (360 * #turns/5 volts * any gear ratio you want to take into account) send an offset, then read back the values as degrees.
It's really slick and works perfectly from our testing (Java). We used it for a swerve drive project, which let us plug the potentiometer object straight into the PID loop to control steering the modules, which worked great as our equations returned an angle to turn to-do we didn't have to do any manual calculation on the value to convert it to volts to get it to work.
__________________
2007 - Present: Mentor, 2177 The Robettes
LRI: North Star 2012-2016; Lake Superior 2013-2014; MN State Tournament 2013-2014, 2016; Galileo 2016; Iowa 2017
2015: North Star Regional Volunteer of the Year
2016: Lake Superior WFFA
|