Hey everybody. I am working on a robot that has a TTL gyroscope. I have used the code here as a a guide for mine, which is very similar. however, I am running into a problem when I add more code to the project. Since the gyro values have to be integrated over time, there needs to be the time constant (see line 34, gyroRate /=100;) which is to say how often the analog input is read.
The issue I am having is that with the addition of other sensors that I am checking (particularly 3 ultrasonic sensors, of which the time to read varies), I find that along with the 10ms delay, there is also the time that it takes for the other sensors to be checked, causing gyro drift since the time constant is not perfect.
Is there a way that I could force the gyro to be checked at a certain time, all the time, regardless of what else is being executed? I was thinking of possibly using interrupts, but I am not familiar with them, and with this type of sensor, it doesn't really have values that fall into the range of rising, falling, etc.