|
Re: Autocalibrate function
The joystick values should be able to be read during initialization, but just to be safe you could read them in the whole time during which the robot is disabled (by checking the disable bit).
We do almost the same thing, since our joysticks often become decalibrated, but instead of reading the joystick values at initialization or while in disable mode, we read them whenever p1_sw_top is depressed. That way we can quickly recalibrate during a match if the trim tab somehow gets moved. To calibrate before the match, we simply hit the button while the robot is on but disabled.
Hope this helps.
__________________
Patrick Fairbank
Team 254 | Mentor (2012-)
Team 1503 | Mentor (2007-2011)
Team 296 | Alumnus (2001-2004) | Mentor (2005-2006)
patfairbank.com
|