View Single Post
  #5   Spotlight this post!  
Unread 26-01-2008, 18:30
Neurovirus Neurovirus is offline
Registered User
FRC #0224
 
Join Date: Jan 2008
Location: Piscataway
Posts: 13
Neurovirus is an unknown quantity at this point
Re: using easyC to give more control to the joysticks

Quote:
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.
so "ramping" and "answer" are variables along with "ramp"?
I don't get "long ramping (unsigned char ramp)
Also if i typed the code u posted into easyC along with some other blocks, will it work?
Thanks