Advanced motor functions

Hi there guys! I’ve been kind of stumped on a coding thing (I’m not a very advanced coder). I have been wondering how I could base a motor rotation function off of a math function, say a sin curve, and based on the X & Y, have my motor power run the Y of the function, over the X being the rotation degrees of the motor. Is there a way to do this, Or a more simple method of accomplishing it?

Thanks!

Use set motor velocity to set the velocity to your function.

In your function use get motor degrees as x

It was not clear what exactly you are trying to achieve.

If you are looking for a way to map control values from joystick position to the velocity target values that you send to the motors you may find helpful information in this topic: What do you think is a more efficient way to drive your robot? - #42 by _Colossus

If you are looking for a way to reduce power to the motor when it comes close to the target position in autonomous code, then you need to search forum for PID algorithm examples, like this one Very Simple Very Accurate Chassis Control Code Release

Let us know if you had something else in mind and don’t forget to bookmark V5 online API reference: VEX Help

Thank you! Sorry it was a little unclear what I was trying to do, I was trying to write something similar to deceleration code, but was unsure of how to create that with my current coding knowledge.