View Single Post
  #4   Spotlight this post!  
Unread 18-01-2008, 00:50
JohnC's Avatar
JohnC JohnC is offline
my other name is nigel
FRC #0360 (360 Revolution)
Team Role: Programmer
 
Join Date: Mar 2005
Rookie Year: 2005
Location: user_routines.c
Posts: 100
JohnC is a jewel in the roughJohnC is a jewel in the roughJohnC is a jewel in the roughJohnC is a jewel in the rough
Send a message via AIM to JohnC
Re: Reducing the sentivity of the joystick in easyC Pro

This was last year's drive code:
Code:
if(p1_sw_trig && p2_sw_trig) {
  Left(p1_y);
  Right(p2_y);
} else {
  Left(Scale_Offset(p1_y,driveScale);
  Right(Scale_Offset(p2_y,driveScale);
}

//later, not in the routine that loops every 26.2 ms...

int driveScale = 3;

int Scale_Offset(int speed, int scaleFactor) {
  return ((speed-127)/scaleFactor) + 127;
}
It worked really well for us
__________________
What place are we at? ... TODAI!