How to program for gyroscope?

#1

Hi,

We have been trying to use the gyroscope in VEX IQ autonomous mode, and haven’t had much luck, as it seems the default way of using it doesn’t really help, it’s not accurate and inconsistent.

I searched on the forum and found most threads in the past are for EDR, not IQ.

I read online that it needs to be calibrated each time before running the program. Is there sample code how it should be done?

I also read that it would be more accurate to turn with absolute values (like turn to 125 degree position) than with relative angles (like turn 90 degrees from current position). Is there sample code how to do that?

Thanks,

Jason

0 Likes

#2

Take a look here. It’s in Robot Mesh Blockly, but the logic might help you even if you are programming in another language.

0 Likes

#3

I found this video helpful for the calibration code:

0 Likes

#4

it says the video is unavailable. “restricted. it must be approved for you to view it”

0 Likes

#5

Oh really? Ok then. Try copying and pasting this link: https://youtu.be/7SGBjX_Q0Yc

0 Likes

#6

thanks for your suggestions, I’ll check them out.

0 Likes