Go to Post It's just another design constraint that needs to be dealt with. - Dave Scheck [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #9   Spotlight this post!  
Unread 24-04-2008, 10:54
Mr. Lim Mr. Lim is offline
Registered User
AKA: Mr. Lim
no team
Team Role: Leadership
 
Join Date: Jan 2004
Rookie Year: 1998
Location: Toronto, Ontario
Posts: 1,125
Mr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond repute
Re: Joystick Input Mapping

The lookup tables suggested earlier are definitely the way to go.

If you're looking for a quick and dirty method to test things out, you can also try:

Code:
temp_p1_long = (signed long)p1_y - 127;
pwm01 = (unsigned char)(((temp_p1_long * temp_p1_long * temp_p1_long)  >> 14) + 127);

temp_p2_long = (signed long)p2_y - 127;
pwm02 = (unsigned char)(((temp_p2_long * temp_p2_long * temp_p2_long)  >> 14) + 127);
It's a cubic transfer function that we've used since 2004. If it works for you, you're eventually better off calculating the values from the function, and using a look-up table for competition. The long integer operations are a bit wasteful, but it's four quick lines of code for testing!
__________________
In life, what you give, you keep. What you fail to give, you lose forever...
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Joystick Input for Rotation about Z-Axis manderson5192 Control System 5 19-01-2008 18:48
Joystick Input calibration in software LieAfterLie Programming 3 14-02-2007 21:44
issues limiting a joystick input Unholy Programming 7 12-02-2006 19:53
Change joystick to pwm mapping Joe Lewis Programming 3 30-03-2005 19:27
2.5 is alive !!!! (input ! .. more input ! ) Lloyd Burns Programming 2 14-01-2003 19:15


All times are GMT -5. The time now is 08:22.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi