Our gyro value is always reading 0.00. We have tried putting the gyro in multiple legacy ports. Currently, we are using legacy port C for the gyro. Our VexNet is plugged into port 17 while ports 16 and 18 are clear.
The bug in 1.0.4 really had nothing to do with the gyro or legacy ports, it just affected them if the radio was plugged into port 21.
Make sure you have the gyro plugged in the correct way around and the green led is illuminated on the gyro. How are you reading the gyro ? perhaps show us the code you are using.
Thanks for the response, Here is the code we use.
float readGyroValue() {
float gyroValue = Gyro.value(vex::rotationUnits::deg);
log(LOG_H_GYRO_VALUE, "gyroVal: %3.2f ", gyroValue);
return gyroValue;
}
Adding a me too to this. Went from 1.03 → 1.05 and our gyro is no longer working. ![]()
Hm, ok, I tested this not 15 minutes ago and a gyro on the test system is working ok.
Can you run the V5 Firmware update utility available from here.
(A standalone VEXos updater is also available for both Windows and Mac.)
make sure VCS or any other programming solution is closed. Click on the blue info button and send me the output. It will show the internal version of everything and whether the legacy port controller was updated correctly.
Are you both programming with VCS or something else ?
Do you see changing values on the 3wire dashboard if you configure it as an analog input. It should show values somewhere around 1800.
We use VCS. Values (19## something?) appear in the dashboard when no program is running, but they don’t seem to change when the robot is being turned like in the previous version. From memory this is not where is was before the update. It was always 1863-65 before the update. The value just hovers around the neutral voltage regardless if the bot is still or turning. Once any program is started the value drops to zero and stays there.
I will try the update utility tomorrow.
Thanks!
I am using VCS as an uploader, and programming in CLion by using the #include.
Hm. ok, not sure what may be wrong.
There were no changes to the gyro code in this update. We did change slightly the way we configure the legacy ports from user code to reduce the delay mentioned in this thread.
however, that does not impact how the dashboard would be reading the analog input values.
The two gyros I tested would only turn in small ranges ex 170-190 or 122-130. I tried testing with another brain, but this didn’t work either.
do you let the V5 handle the calibration or try and perform any calibration yourself in your code ?
My kids confirmed that v1.0.5 does work with Gyro connected to three wires legacy port including Radio connected to smart port 21.
Make sure your wiring is connected correctly and you have green light on the gyro when the brain is turned on.
Well, color me embarrassed. Our sensor was plugged in backwards. It must have happened at the same time as the firmware update, and hence the confusion and the non functionality after the update.
Always check the basics first kids!
FYI the green light will be on, and you will get a reading in the dashboard with the cable plugged in the wrong way.
Sorry for the noise!
I use the
gyro.StartCalibrating()
function to cslibrate my gyro.
you don’t really need that, gyro will always calibrate when your code starts, but it won’t hurt.
I still don’t see any issues with 1.0.5, try this simple program and let us know if this works.
vex::gyro Gyro1( Brain.ThreeWirePort.C );
int main() {
Brain.Screen.setFont( mono40 );
Gyro1.startCalibration();
while(1) {
Brain.Screen.printAt( 10, 50, "Gyro %6.1f", Gyro1.value( vex::rotationUnits::deg ) );
// Allow other tasks to run
vex::this_thread::sleep_for(50);
}
}
We have solved our issue!
@jpearman we believe that there were changes in how sonar is handled by 1.0.4+. Our sonar was removed from our robot a few months ago. We left some logging code in place that reads sonar value in a loop. In 1.0.3 the side effects of reading a sonar that didn’t exist seemed to change.
I guess that in 1.0.4+ reading a sonar that had been removed from a robot causes issues with gyros.
I’ll check next week but we haven’t touched the sonar since the original 1.0.0 release.