View Single Post
  #4   Spotlight this post!  
Unread 25-01-2008, 15:40
psy_wombats's Avatar
psy_wombats psy_wombats is offline
Registered User
AKA: A. King
FRC #0467 (Duct Tape Bandits)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Shrewsbury MA
Posts: 95
psy_wombats has a spectacular aura aboutpsy_wombats has a spectacular aura aboutpsy_wombats has a spectacular aura about
Re: using easyC to give more control to the joysticks

Well, I've pasting this everywhere, so it might as well be here as well:

Code:
long ramping (unsigned char ramp)
{
    long answer = 0;
    answer =  ((long)ramp - 127);
    answer = ((answer) * (answer) * (answer));
    answer = ((answer) / (128 * 128));
    answer = (answer) + (127);
    return answer;
}
However, you don't need to subtract 127 and then add it again unless your drive is centered around 127. Here's a graph of joystick input versus PWM value. Is that what you intended?

http://www.chiefdelphi.com/forums/at...9&d=1201127844

And in previous years we have used a 'half inputs' button. Just subtract 127 before halving and add it back later. (Assuming neutral is 127) It works fairly well when you need precision, but no one ever remebered to use it. Maybe with decent driver training.

Last edited by psy_wombats : 25-01-2008 at 15:47.