How to program for gyroscope?

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

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

I found this video helpful for the calibration code:

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

Oh really? Ok then. Try copying and pasting this link: Vex IQ 108 - Fixing Gyro Drift - YouTube

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