Okay, I was talking to bombadier337 yesterday. He was telling me this would work fine but I would need it to have a bigger dead zone otherwise the motor will be jumping back and forth tryign to land right on the target. Also, he said I should make it so the farther away the target, the faster the turret spins. So maybe something like...
Code:
if (PAN_SERVO > 210) TURRET = 255;
else if (PAN_SERVO > 170) pwm01 = 180;
else if (PAN_SERVO > 150) pwm01 = 150;
else if (PAN_SERVO > 140) pwm01 = 140;
else if (PAN_SERVO < 114) pwm01 = 110;
else if (PAN_SERVO < 100) pwm01 = 100;
else if (PAN_SERVO < 60) pwm01 = 60;
else if (PAN_SERVO < 40) pwm01 = 30;
else pwm01 = 127;
Okay, that should be something like that. And it does need to be before PutData... right? Ill have to try it today after school. THANK YOU bombadier337!! And the rest of you.
Now for the Tilt. We were talking.... with the setup I have... would the Geartooth work for making the tilt of the gun. We have the threaded pole and it turns to raise and lower.
__________________
TEAM 1706
2007 Judges Award, St. Louis (For our amazing ability to have bad luck)
2005 Rookie Inspiration Award, St. Louis