We noticed that our gyro sensor was not producing accurate readings, so we decided to test it in a test document. Here is the code we used; once we put the code in the test document, we tried to recalibrate the sensor by setting the SensorType to none and then back. However, after we did that, in the debug window, the gyro sensor reading on longer shows up.
#pragma config(Sensor, in1, gyro, sensorGyro)
#pragma config(Sensor, dgtl1, right, sensorQuadEncoder)
#pragma config(Sensor, dgtl3, left, sensorQuadEncoder)
#pragma config(Motor, port1, ChassisR, tmotorVex393HighSpeed_HBridge, openLoop)
#pragma config(Motor, port2, ChassisRR, tmotorVex393HighSpeed_MC29, openLoop, reversed)
#pragma config(Motor, port3, ChassisRRR, tmotorVex393HighSpeed_MC29, openLoop)
#pragma config(Motor, port4, ArmL, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port5, ArmT, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port6, ClawL, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port7, ClawR, tmotorVex393_MC29, openLoop, reversed)
#pragma config(Motor, port8, ChassisLLL, tmotorVex393HighSpeed_MC29, openLoop, reversed)
#pragma config(Motor, port9, ChassisLL, tmotorVex393HighSpeed_MC29, openLoop)
#pragma config(Motor, port10, ChassisL, tmotorVex393HighSpeed_HBridge, openLoop, reversed)
//!!Code automatically generated by ‘ROBOTC’ configuration wizard !!//
task main()
{
SensorType[gyro] = sensorNone;
wait1Msec(1000);
SensorType[gyro] = sensorGyro;
wait1Msec(2000);
while (SensorValue[gyro] <= 900) {
motor[ChassisL] = -127;
motor[ChassisLL] = -127;
motor[ChassisLLL] = -127;
motor[ChassisR] = 127;
motor[ChassisRR] = 127;
motor[ChassisRRR] = 127;
}
}