View Single Post
  #11   Spotlight this post!  
Unread 12-03-2008, 09:42
JDM JDM is offline
programming lead; team executive;..
FRC #2199 (Robo-Lions)
Team Role: Programmer
 
Join Date: Feb 2008
Rookie Year: 2008
Location: Eldersburg, Maryland
Posts: 34
JDM is on a distinguished road
Re: How to Auto Calibrate

Quote:
Originally Posted by jamie_1930 View Post
After thinking about this I think I have your code.
if(trig_sw==1)
x1==127
y1==127
x2==127
y2==127
This should be it. Although you still want to check the variables
x1,x2,y1,y2 are supposed to be the joystick direction.

All this would do is set the joystick values to 127 for execution of the code loop. To have it really calibrate you need to store the offset from 127 into a variable and then have the code add/subtract it each time.