Can someone teach me or show me to code rotational sensors

i know almost nothing about coding rotation sensor PLS HELP

Check programming language docs. No one here is gonna outright give you code (but they will point you in the right direction)

1 Like

This is a link to the API for rotation sensors if you’re using VEXcode Pro V5.

This is a link to the API for rotation sensors if you’re using PROS.

The rotation sensor has an encoder that turns on a shaft. The sensor can then either return the angle of the shaft or the total rotation of the sensor since the last reset. You can think about it like this: if I spun a wheel connected to the sensor 540 degrees, the angle would be 180, but the position would be 540.

You can also set the sensor to be a particular value as well. If you had a lift and wanted to know the angle of the lift at all times, it would be useful to know the starting angle. You can set the starting angle as 0 and have all other angles relative to that 0.

You can also reset the position of the sensor to 0 with the reset function.

Finally, you can get the speed that your shaft is rotating using the velocity function.

2 Likes