Hi all. I have written some code for my GPS sensor, and it spins in a circle. When I plugged in the GPS sensor and the light was flashing, I assumed it was a port issue and tried many things such as switching the cord, moving ports, trying motors with the same conditions, etc. I’m down to the conclusion that my GPS sensor is probably dead, and wanted to either try and see if that ounce of hope is worth it, or see if it’s repairable.
When using GPS.display(), it returns a 0. It doesn’t show up on the devices on the V5 brain. GPS strips are properly installed on the field I tested it on. Included below are both the code I used, a GIF of the phenomenon happening, and the V5 brain not detecting it. It is plugged into port 1. (excuse the bad angle).
Code
GPS.calibrate();
while (GPS.isCalibrating()) { task::sleep(25); }
Drive.setHeading(GPS.heading(), degrees);
Drive.setTurnVelocity(100, percent);
GPS.quality();
con.Screen.clearScreen();
con.Screen.setCursor(1,1);
con.Screen.print(GPS.quality());
float startingX = GPS.xPosition(mm);
float startingY = GPS.yPosition(mm);
float endingX = 0;
float endingY = -1000;
float turnAngle = atan((endingX - startingX) / (endingY - startingY)) * 180 / M_PI;
if (endingY - startingY < 0) {
turnAngle = turnAngle + 180;
}
Drive.turnToHeading(turnAngle, degrees, true);
float driveDistance = sqrt(((endingX - startingX) * (endingX - startingX)) + ((endingY - startingY) * (endingY - startingY)));
Drive.driveFor(forward, driveDistance, mm, true);
Thank you!