would not set the gyro back to being a gyro sensor after the three seconds? I have been attempting this code in a separate task main, with the debugger sensor up, and without fail, everytime, the Gyro Sensor Value does not show up… Thank you for your help.
Actually, whenever I set it to sensorNone, it goes off of the list, and won’t even return when I run the function again. I have to reset RobotC to get it to come back up, but once I run a program that sets in3 to sensorNone, it won’t show up…
We’ve had no trouble with it using it as @NattyMan0007 is suggesting. However, we did call the function multiple times in our autonomous code, so that we could “reset” the gyro before each turn. What we found that was actually easier for these mini resets was to do this instead:
SensorValue[gyro] = 0;
This kept the value available on the debugger and didn’t require any waiting between turns.
@ShadowIQ If your results are oscillating, try changing the sensor port or make sure its in the right analog port. For the debugger stream, try setting up the gyro in the “motors and sensors setup”(I am not certain about this but might be helpful - never mind if you already did it).
Just in case none of these work, try this code:
SensorType[in3] = sensorNone;
SensorType[in3] = sensorGyro;
wait1Msec(2000); // sets analog 3 to gyro.
Your code does not seem to have a wait statement after " SensorType[in3] = sensorGyro;"
Thanks for all of your help. I didn’t realize that if this was not done without the Vex Competition Includes File it wouldn’t work, as I was just plugging it into a task main. I put it in a competition template and it worked.