LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to scale joy stick data

Hi

 

In my application I am acquiring data from a USB type a joystick. I want to scale these values that i am getting from the joy stick. I could use a linear scale. Is there way to use scaling function with joy stick functions? Thanks.

0 Kudos
Message 1 of 5
(3,204 Views)

Of course.  It would just be basic math functions.  Where are you running into problems?  What is the raw data you are getting from the joystick and what do you want to scale it to?

0 Kudos
Message 2 of 5
(3,198 Views)

Hi

Thanks for the reply. The raw data i am geting from joy stick is between -32767 to +32768 (Y axis output). I want to scale it to 0 to 254. I want to control a servo using the joy stick data. Servo controller take values 0 to 254 for the position command.  

0 Kudos
Message 3 of 5
(3,182 Views)
Take the number you get.  Add 32767.  Divide by 65535, multiply by 254.
0 Kudos
Message 4 of 5
(3,170 Views)
Was this answer sufficient? If not, what do you mean by "I want to control a servo using the joy stick data?" What are the units that you are using? Are they the same units between the joy stick and the servo?

If you have questions with controlling the servo controller it would be best to post those questions on the Motion Control and Motor Drive board.
Vince M
Applications Engineer
0 Kudos
Message 5 of 5
(3,132 Views)