How to reset a Gyroscope to Zero

I’m using a Vex EDR with RobotC 4.08. I have a Yaw Rate Gyroscope Sensor. How do I reset the gyroscope sensor to zero. Every time I run the program, the sensor value has the value from the last time I ran it.


SensorValue gyroPort ] = 0;

gyroPort is whatever you have defined in the motor & sensors dialog or something like in1 or in2 if you didn’t define anything.

I am using easy c which does not have those features, but you can do it by creating two variables for one gyroscope. You constantly send value to one variable and only send value to the other when you want to zero the gyroscope. The output value will be the subtraction of the two variables.

Just another tip, you can program the gyroscope value to be periodical so that the value automatically goes back to zero after one full revolution. I am planning to use this on my new season robot for innovation. How to do it? Remainder function.