View Single Post
  #6   Spotlight this post!  
Unread 06-02-2007, 22:36
tdlrali tdlrali is offline
Registered User
FRC #0469 (Las Guerrillas)
Team Role: Programmer
 
Join Date: Sep 2006
Rookie Year: 2006
Location: MI
Posts: 377
tdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud of
Re: Bizarre Driving Issue

Also, here's a general thing that will cut down code, therefore space used, will "upload" faster and run faster

Turn this:
Code:
if(p2_x<122) 	//more than 5 below 127
		{
			deadx = ((p2_x - 122) * 127)/122 + 127;	//scaling so we don't just jump from 127 to 121 but can still reach 0
		} else if(p2_x>132)	//more than 5 above 127
		{
			deadx = ((p2_x - 132) * 127)/122 + 127;	//scaling
		} else
		{
			deadx = 127;	//don't move if within 5 of 127
		}
into

Code:
if(p2_x>=122 && p2_x<=132) 	//within deadzone
	deadx = 127; //dont move
else //outside deadzone
	deadx = ((p2_x - 132) * 127)/122 + 127;	//scaling