Handling joystick inputs for controlling robotic arm?

My bad

You need to post your complete program so we can see how that function is used.

If it is something to do with a joystick I don't think there is any value in using floating point maths which is very slow on an Arduino.

Also this seems to be the same project as your other Thread. It is much easier to help when you ask all the questions about one project in one Thread so all the info is in one place.

You can click Report to Moderator and ask to have them merged.

...R

PS I have just discovered that you have THREE threads about this project. If I had know that I would not have replied to any of them. Ask the moderator to merge them.