Go to Post After all, it's not where you are but the people you're with that make it worth while. - RoboJedi75 [more]
Home
Go Back   Chief Delphi > Technical > Control System
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 04-05-2005, 01:39
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Joysticks

Quote:
Originally Posted by billbo911
I've often wondered how I could linearize a range of values to another range of values, such as 137-235 linearized to 137-254...So the question is, what code would you use to linearly map one range to another?
Use the equation for a line, y = mx + b.
Take the input value x, multiply it by a factor m, and add an offset b to yield the output value y. The factor can be a floating point value, or to save time you can multiply by an integer and divide by another integer.
To determine the m and b constants, use algebra to solve the pair of equations for the known input and output values.
  #2   Spotlight this post!  
Unread 04-05-2005, 10:15
billbo911's Avatar
billbo911 billbo911 is offline
I prefer you give a perfect effort.
AKA: That's "Mr. Bill"
FRC #2073 (EagleForce)
Team Role: Mentor
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Elk Grove, Ca.
Posts: 2,369
billbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond repute
Re: Joysticks

Quote:
Originally Posted by Alan Anderson
Use the equation for a line, y = mx + b.
Take the input value x, multiply it by a factor m, and add an offset b to yield the output value y. The factor can be a floating point value, or to save time you can multiply by an integer and divide by another integer.
To determine the m and b constants, use algebra to solve the pair of equations for the known input and output values.

Thank You Alan

I knew it would be a relatively simple solution.
My years removed from Algebra are many, too many in fact, so some portions of my memory need a little refresh. This will help tremendously.
Closed Thread


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
2004-2005 Joysticks kjohnson Control System 3 11-04-2005 23:39
Pressure sensative Joysticks Validius General Forum 1 15-03-2005 13:59
number of joysticks Waste General Forum 21 27-01-2005 15:04
need joysticks! Tom Bottiglieri General Forum 14 24-02-2004 09:36
AVB joysticks..and other analogue joysticks tml240 Kit & Additional Hardware 6 07-02-2004 12:45


All times are GMT -5. The time now is 06:03.

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