View Single Post
  #6   Spotlight this post!  
Unread 26-01-2008, 18:38
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

Alright, I guess EasyC doesn't use function syntax like that. Sorry, I'm really not familiar with it.

In the code given, only 'answer' and 'ramp' are variables. The function's name is 'ramping.' When you call ramping(ramp) where var is an unsigned char, it returns the long 'answer.' This would be how to use it in any code, I guess:

Code:
answer = ((long)ramp - 127);
answer = ((answer) * (answer) * (answer));
answer = ((answer) / (128 * 128));
answer = (answer) + (127);
Just make sure to change 'answer' to whatever variable name you are using for your joystick(s) in values. Just use this on all of your joystick inputs before assigning the PWMs. That should work, maybe somebody more knowledgable in EasyC could help you better.