View Single Post
  #5   Spotlight this post!  
Unread 13-02-2005, 14:38
Joshua May's Avatar
Joshua May Joshua May is offline
Go Bears!
FRC #1110 (Binary Bulldogs)
Team Role: College Student
 
Join Date: Nov 2003
Rookie Year: 2003
Location: Berkeley, CA
Posts: 1,306
Joshua May has a reputation beyond reputeJoshua May has a reputation beyond reputeJoshua May has a reputation beyond reputeJoshua May has a reputation beyond reputeJoshua May has a reputation beyond reputeJoshua May has a reputation beyond reputeJoshua May has a reputation beyond reputeJoshua May has a reputation beyond reputeJoshua May has a reputation beyond reputeJoshua May has a reputation beyond reputeJoshua May has a reputation beyond repute
Send a message via AIM to Joshua May
Re: joystick sensitivity

One thing we did was add in a "deadband" to the center of the joysticks, which has really helped. The code makes use of an absolute value function that we created. Today, we'll also be adding a ramping function to the joysticks just like what was described above, I can get you that code too if you need it.

Code:
#define DEADBAND 10

int abs(int x)
{
  if (x >= 0)
    return x;
  else
    return -x;
}

if (abs((p1_y - 127)) < DEADBAND)
  p1_y = 127;

if (abs((p1_x - 127)) < DEADBAND)
  p1_x = 127;
__________________
The FIRST Wiki - openFIRST - Ultimate Robot Challenge - URC Wiki
I currently have 50 GMail invites, PM or email me for one.
UC Berkeley Class of 2009

2005 Las Vegas Regional Autodesk Visualization Award
2005 Las Vegas Regional #8 Seeded Alliance with 988 and 1505
2006 Southern California Regional #15 seed