How to cube a joystick controll to make a non-linear motor movement in python

What I want is to have is like this picture but code it in python
43632691_2456050234422229_1423850369510801408_n

1 Like
1 Like

What happens mathematically when you cube a number? What arithmetic operation(s) are involved?

How would you take the input value from the joystick and change it according to arithmetic operation(s) you identify above?

Other questions to ask yourself / experiment with:

  1. What are the range of values given by the Joystick axis in Vex Python?
  2. Does that range match the -1 to 1 range you specify above?
  3. If not, how can you manipulate the values to do so?
5 Likes

Take the input joystick, divide it by its maximum value. Cube that value, multiply by maximum motor input value and send to motor.

3 Likes

How do I

1: find the joystick input in percentage

2: find the maximum value

3: find the motor maximum value

The Vex Code documentation contains this information and can be found: VEX Help

Alternatively, it can be helpful in situations like this to print out values either to the Brain, the Controller, or the Terminal.

3 Likes

this is left as an exercise for the reader

5 Likes

So there is the code for joystic axis but how would i make that into a number?

You are on the right path. Keep going thru the documentation or whatever method led you to find the axis and you’ll find your answer.

I lloked through the documentation you linked but cant find it any hints to where its at?

Not sure why you are having so much trouble with this.
Unfortunately the documentation that was linked is for C++, however, assuming you are using VEXcode to program, create a controller device using the graphical configuration and then help will give you everything you need.

7 Likes